-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to build mapping that one table is referred by 2 fields?
PostPosted: Fri Jul 11, 2008 4:51 am 
Newbie

Joined: Tue May 20, 2008 6:54 am
Posts: 3
Location: Indonesia
Dear All,
How to build a hibernate mapping that one table is referred by 2 fields, so TabelA field1 and field2 is reffers to TableB field1 and field2

TIA

_________________
^0^


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 11, 2008 10:51 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Are you saying that you want to duplicate data in two separate database tables? Is there a compelling reason for doing this. A better approach would be to keep the data in one place, and have Hibernate associations between classes reference each other tables' data.

So, what's the need for this approach?

One thing I do when I need history tables is to perhas have a trigger that runs when one table is changed an another needs to be updated. That's more at a database level though.

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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

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.