| Code: |
|
_RootDAO.initialize(); PersonDAO dao = new PersonDAO(); List people = dao.findAll(); |
| Code: |
|
Long id = new Long(3); Person person = dao.load(id); person.setFirstName("Joe"); dao.update(person); |
| Code: |
|
Transaction tx = dao.beginTransaction(dao.getSession()); // the above code tx.commit(); |
| Code: |
|
_RootDAO.initialize(); PersonDAO dao = new PersonDAO(); Transaction tx = dao.beginTransaction(dao.getSession()); //.. // my update code //.. dao.commitTransaction(tx); |