-->
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: parent->child->grandchild plus parent->grandchild r
PostPosted: Tue Apr 01, 2008 10:57 am 
Newbie

Joined: Tue Apr 01, 2008 10:31 am
Posts: 2
Hello,

I am having troubles to map this relationship from my database in hibernate.

I have one table (grandchild) with products.
I have a second table (child) with productgroups. Every productgroup contains 1 or more products.
I have a third table (parent) which are contracts. A contract can reference either a product group or a product (or neither one).

The database schema is an existing productive environment, i can't change it.

I use Hibernate 3.2 with annotations.

I did a lot of research but i couldn't find anything, maybe because im not searching for the correct terms. Any help would be appreciated.

Thanks

PS: I let hibernate auto-generate my classes, It made a relationship from parent to grandchild and from grandchild to child. This works fine for all cases where the contract references a product (including product group). The only problem i have is when the contract references just a product group without a specific product.


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.