-->
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: one-to-one with one class?
PostPosted: Tue Jan 27, 2004 4:23 pm 
Newbie

Joined: Tue Jan 27, 2004 4:16 pm
Posts: 1
Like many people, I'm dealing with an existing database that hasn't been designed very well. I am in a situation where I have 2 tables with a one-to-one mapping via a PK. When a row in one table exists, it always exists in the other table.

What I would like to do is logically tie these together into one class, as it makes more sense from the business perspective. So in this case, instead of table-per-class, I would have 2tables-per-class. Is there any way to do this? Everything I see about the one-to-one mapping type indicates that 2 classes are required.

I can see how I could create synthetic accessors in the classes to deal with the problem, but I would rather avoid that if possible. (seems a little kludgy)

Thanks,
Mug


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 27, 2004 6:34 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
This is not yet possible (might be in 2.2.) solve this on the java side using object agregation.


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.