What do you mean by reset? Changed to some default value, or changed to what they were before some recent in-memory updates?
Hibernate doesn't provide a way to do either of these things. You have to know the default values yourself, and you have to manually undo changes or rollback transactions if you need to.
You can use session.refresh(object) to reject all changes in object (i.e. get the current DB values back into the object), then re-make all the "correct" changes. But the best plan is to only make "correct" changes in the first place. One way of doing this is to construct an in-memory version of the relevant object and make your changes to it. When you're ready to save, copy the "correct" changes to the persistent version of the object, and save that.
_________________ Code tags are your friend. Know them and use them.
|