Regular |
|
Joined: Tue May 11, 2010 5:50 pm Posts: 54 Location: Norman, Ok, U.S.A
|
I want to know if there is any way to map same entity to several tables in Hibernate annotations. Like there is in the Entity name in the Xml mapping files, where we can call the entity name instead of the class and hibernate takes care of the rest based on the entity name and we can then just map the same class to several tables that have the same layout. I know there is @MappedSuperclass and @Entity with Inheritance annotation, but this is not the answer of my question. I even looked at the SecondaryTable, but that should be used with distributed values.
For Example if I have a table called TableOne and another TableTwo and they are identical. I have data from TableOne saved somewhere and now I want to populate TableTwo with the same data at some point in time, what would be a good solution?? Or should I go back to XML mapping files??
Thanks
|
|