-->
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: Single class, multiple mappings.
PostPosted: Fri Jul 18, 2008 10:26 am 
Newbie

Joined: Fri Jul 18, 2008 10:14 am
Posts: 5
Hibernate version:3.1.3

Something I searched upon and did not get an answer to.

Well, to begin with, I am trying to implement Hibernate on legacy DB, which is pretty much denormalized.

Is there any way, how I would be able to write multiple hibernate mappings for a same class?

I faced this problem when I first mapped one column CA1 of Tabel A to a column in Table B CB1 as a foreign key in Table B. But, now I want to map the same column CA1 of Table A to be mapped as a foreign key in another table Table C too.

I get the duplicate mapping error, which I was expecting anyways.

Question is, how do I do this?

_________________
Somebody tell me..!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 19, 2008 10:03 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
I don't think you'll be able to do it multiple times on a class. YOu could always duplicate the class and put it into different packages?

_________________
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.