Hi
I've this problem with Hibernate. The following lines of code are from an update() function:
Code:
Transaction tx = userDao.getSession().beginTransaction();
AclUser user = (AclUser)userDao.findByProperty("username", userName).get(0);
user.setFirstName("orm1212");
userDao.save(user);
tx.commit();
This code is not returning any error, however it's not doing what it's supposed to be doing, i.e persisting the change in firstname.
However the following code works!
Code:
Transaction tx = userDao.getSession().beginTransaction();
AclUser user = (AclUser)userDao.findByProperty("username", "danielw").get(0);
user.setFirstName("orm1212");
userDao.save(user);
tx.commit();
The only difference is line 2 where findByProperty() is called. I am no longer able to pass a parameter. This is kind of strange. I have tried my luck, so any help would be much appreciated.
Thanks