Hi,
I am building a JSF web app that uses Hibernate for persistence. It's working very well. Hibernate is awesome.
I issue a query and get an object that I want to let the user edit. The user makes some changes to the object. I then need to issue some hibernate queries. The user hasn't indicated to "save" the changes so I don't yet want to store the changes. I'm finding that even though I haven't told hibernate to save the object the user is editing, Hibernate is automatically issuing an UPDATE to persist the changes the user made when I issue my other queries.
I turned on the Hibernate debugging to see the SQL queries that Hibernate issues. This is very useful in helping me understand what's going on.
I'm wondering if there is a way to tell Hibernate to "forget" about an object that I've retrieved for the user to edit. Then when the user clicks "save" I'll reconnect the Hibernate object and save it. If the user never clicks save, then the database will remain unchanged.
Any suggestions on how to implement this?
Thanks, John
|