Example usage for org.hibernate Session update

List of usage examples for org.hibernate Session update

Introduction

In this page you can find the example usage for org.hibernate Session update.

Prototype

void update(Object object);

Source Link

Document

Update the persistent instance with the identifier of the given detached instance.

Usage

From source file:com.bs.dao.AttendanceDao.java

@Override
public boolean doUpdateAttendance(Attendance attendance) {
    Session s = HibernateUtil.getSessionFactory().openSession();
    try {/*from   ww w . j  av a  2 s  . co  m*/
        s.beginTransaction();
        s.update(attendance);
        s.getTransaction().commit();
        return true;
    } catch (Exception e) {
        return false;

    } finally {
        s.close();
    }
}

From source file:com.bs.dao.BManagerDao.java

@Override
public boolean doUpdateBManager(BManager bManager) {
    Session s = HibernateUtil.getSessionFactory().openSession();
    try {//from  w w  w  .ja  va 2 s . c o  m
        s.beginTransaction();
        s.update(bManager);
        s.getTransaction().commit();
        return true;
    } catch (Exception e) {
        return false;

    } finally {
        s.close();
    }
}

From source file:com.bs.dao.CustomerDao.java

@Override
public boolean doUpdateCustomer(Customer customer) {
    Session s = HibernateUtil.getSessionFactory().openSession();
    try {/*from  www . j  a  v  a2 s  .c  om*/
        s.beginTransaction();
        s.update(customer);
        s.getTransaction().commit();
        return true;
    } catch (Exception e) {
        return false;

    } finally {
        s.close();
    }
}

From source file:com.bs.dao.EmployeeDao.java

@Override
public boolean doUpdateEmployee(Employee employee) {
    Session s = HibernateUtil.getSessionFactory().openSession();
    try {//ww  w . ja v  a 2  s.  co  m
        s.beginTransaction();
        s.update(employee);
        s.getTransaction().commit();
        return true;
    } catch (Exception e) {
        return false;

    } finally {
        s.close();
    }
}

From source file:com.bs.dao.LocationDao.java

@Override
public boolean doUpdateLocation(Location location) {
    Session s = HibernateUtil.getSessionFactory().openSession();
    try {/*from   w w  w.j a  v a2  s  . co  m*/
        s.beginTransaction();
        s.update(location);
        s.getTransaction().commit();
        return true;
    } catch (Exception e) {
        return false;

    } finally {
        s.close();
    }
}

From source file:com.bs.dao.ManagerDao.java

@Override
public boolean doUpdateManager(Manager manager) {
    Session s = HibernateUtil.getSessionFactory().openSession();
    try {//from  w w w .  jav a2 s  .  c  o m
        s.beginTransaction();
        s.update(manager);
        s.getTransaction().commit();
        return true;
    } catch (Exception e) {
        return false;

    } finally {
        s.close();
    }
}

From source file:com.bs.dao.ProductDao.java

@Override
public boolean doUpdateProduct(Product product) {
    Session s = HibernateUtil.getSessionFactory().openSession();
    try {/*from   w  ww. j a  v  a2s .c o m*/
        s.beginTransaction();
        s.update(product);
        s.getTransaction().commit();
        return true;
    } catch (Exception e) {
        return false;

    } finally {
        s.close();
    }
}

From source file:com.bs.dao.SalaryDao.java

@Override
public boolean doUpdateSalary(Salary salary) {
    Session s = HibernateUtil.getSessionFactory().openSession();
    try {/*from  ww  w .  j ava  2s. co  m*/
        s.beginTransaction();
        s.update(salary);
        s.getTransaction().commit();
        return true;
    } catch (Exception e) {
        return false;

    } finally {
        s.close();
    }
}

From source file:com.bs.dao.SuppervisorDao.java

@Override
public boolean doUpdateSuppervisor(Suppervisor suppervisor) {
    Session s = HibernateUtil.getSessionFactory().openSession();
    try {/*from w ww .j a va2 s  .  com*/
        s.beginTransaction();
        s.update(suppervisor);
        s.getTransaction().commit();
        return true;
    } catch (Exception e) {
        return false;

    } finally {
        s.close();
    }
}

From source file:com.bs.dao.SupplierDao.java

@Override
public boolean doUpdateSupplier(Supplier supplier) {
    Session s = HibernateUtil.getSessionFactory().openSession();
    try {//from   ww  w  . jav  a2  s .com
        s.beginTransaction();
        s.update(supplier);
        s.getTransaction().commit();
        return true;
    } catch (Exception e) {
        return false;

    } finally {
        s.close();
    }
}