Hi All,
I could not find any documentation related to this. We are migrating an existing Toplink application to hibernate. In the current application once we read any persisted object from the database through Toplink (which makes a backup of read object and refers to it as original Object).
The persisted object is cloned and given to the calling application. The application uses this cloned object and makes changes to this object, however Toplink always maintains an untouched original object. When this object is saved through Toplink it will be compared with the original object and the new clone will be saved.
The above is termed as inspection in Hibernate (or ORM terms). Which is very similar to what Toplink does. But somehow our application needs the original object to make some decision of our own. So toplink provides us with an API where we can give the (clonedObject) and it will return us the unmodified version of object that was read from database intially.
I have seen lot of references to findDirty and dirtychecking, but I am not sure if it will get us the original copy if we give the clone. I know from documentation that hibernate does maintain the original copy, is there an easy way to retreive it , either by classname its id or some other means.
I appreciate all the help in advance.
Hibernate version:
[INFO] Environment - Hibernate 3.0.5
Mapping documents:
not needed
Code between sessionFactory.openSession() and session.close():
not needed
Full stack trace of any exception that occurs:
not needed
Name and version of the database you are using:
not needed
The generated SQL (show_sql=true):
not needed
Debug level Hibernate log excerpt:
not needed
_________________ Amish Shah
OPNET Technologies
|