-->
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 configure Parent/Children/Grandchildren...
PostPosted: Fri Jan 28, 2005 5:40 am 
Newbie

Joined: Fri Dec 03, 2004 8:21 am
Posts: 8
Hibernate version: 2.1

I could not find a post related to this. Pardon me, if this or related question is already posted.

I have the following object hierarchy:

1. Order has orderId as Primary Key (PK). It may have one or more OrderDetail objects

2. OrderDetail has (orderId + orderLineNumber) as PK. Each OrderDetail may have one or more Tax objects

3. Tax has (orderId + orderLineNumber + taxTypeCode) as PK.

I was not able to define the <composite-id> for the Tax with OrderDetail as <many-to-one> relation.

How do we define this relationship in Hibernate when I need:

Option 1: Navigable from both directions
Option 2: Navigable from Order to OrderDetail to Tax

I am okay with list, set, map, or bag representation.

Thanks,

_________________
joshi


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 28, 2005 5:51 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
There are examples of this in the Hibernate3 test packages. (org.hibernate.test.cid, I think)


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.