-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Mapping one entity to several tables in Hibernate annotation
PostPosted: Tue May 11, 2010 5:58 pm 
Regular
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.