-->
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.  [ 3 posts ] 
Author Message
 Post subject: How to model a collection within a collection?
PostPosted: Tue Jun 29, 2004 11:43 am 
Newbie

Joined: Tue Jun 29, 2004 9:35 am
Posts: 6
Apologies if this is boneheaded, I'm a total newbie..

I have three classes

Booking 1---* BookedOrder 1---* BookedOrderLine

I need a Set member variable in Booking called bookedOrders, and a Set member variable in BookedOrder called bookedOrderLines that are auto populated.
I find it's not possible to have a collection within a collection, so I thought the BookedOrderLine.hbm.xml would contain something like this
Code:
<many-to-one name="bookedOrder" class="BookedOrder" column="BOOKED_ORDER_ID"/>


And the BookedOrder.hbm.xml would contain this
Code:
<many-to-one name="booking" class="Booking" column="BOOKING_ID"/>


but it doesn't look like auto population would occur..

Is there a better, more elegant solution? If it's documented and I've missed it I'd be grateful for a pointer in the right direction!

Many thanks

Simon


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 29, 2004 5:36 pm 
Newbie

Joined: Mon Jun 21, 2004 3:43 pm
Posts: 19
did you try to use middlegen? got the HBM files from your database, if you don't want to use SQL to build the database , then you can use Xdoclet to generate HBM files from Java Classs.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 29, 2004 6:16 pm 
Newbie

Joined: Tue Jun 29, 2004 9:35 am
Posts: 6
Middlegen not right for me, I want to generate the SQL from the object model. Will try xdoclet and see what it gives me.
Thanks

S


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.