-->
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: Parent/Child - Extra table creation
PostPosted: Sun Nov 23, 2003 10:56 pm 
Beginner
Beginner

Joined: Tue Nov 18, 2003 12:34 am
Posts: 39
Location: Dallas, Texas, US
Hi,
I have a special case here: There are two Java objects ObjectA and ObjectB. At the database level, I need to have three tables
1. TableA (for ObjectA)
2. TableB (for ObjectB)
3. TableAB (extra table)

The relationship should be of the type:
1. Table A has one-to-many with TableAB (inverse - true)
2. Table AB has one-to-one with TableB (If it was many-to-one with TableB, that would be a piece of cake!)

My problem is due to the following:

1. Hibernate creates the extra table TableAB only if ObjectA has many-to-many relation with another another object (ObjectB).
2. If I define one-to-many for ObjectA, Hibernate ignores creation of TableAB.
3. If I define many-to-many for ObjectA (by specifying TableAB be created) and then define one-to-one for ObjectB, then Hibernate does create TableAB but it does not update.
4. If I had ObjectAB, then it would be easy but I don't this object.

Is there a way to achieve this?

Thanks in advance,
Madhan.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 24, 2003 4:11 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
This is not supported; you would have to remodel the link table as an entity.


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.