Hi,
I am faced with a problem where i have to persist the same object to two different tables at different times.
More specifically, I have an object that needs to be put into a table, say RECORD. I have another table RECORD_HISTORY which has the same columns as the RECORD table. My business requirement needs me to move the record in the RECORD table into the RECORD_HISTORY table when the user deletes a record.
Do i need to have a separate class for persisting in the RECORD_HISTORY table ? If not, how can i specify at run time which mapping file the object should use to persist itself ...
It is my guess that i surely need to have two different mapping files, but can the same class be associated with two different mapping files and how do i specify at run time which mapping file this object should use.
Thanks
Prashanth
|