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: Association help
PostPosted: Sat Aug 05, 2006 8:58 am 
Beginner
Beginner

Joined: Fri Jul 07, 2006 12:08 pm
Posts: 37
I have TransportPackage entity which has a collection of VehicleRates..A transportpackage can have 1-many rates,and a vehiclerate belongs to only one package
TrasnportPackage structure...
-------packageid,name,<IList>VehiceRates,description

VehicleRate structure
-------id,packageid,vehicleid,rate


i have mapped it as..in TransportPackage.hbm..

<bag name ="m_VehicleHireRateCollection" access ="field" inverse ="true" table="TransportPackageVehicleRates">
<key column ="TransportPackageID"></key>

<one-to-many class ="VehicleHireRate" />

</bag>


and in

VehicleRate.hbm..

<many-to-one class ="TransportPackage" column ="TransportPackageID" name ="m_TransportPackage" access ="field"></many-to-one>

now,does vehiclerate class need to have a reference to transportpackage class..can i remove many-one from vehiclerate.hbm and still save..


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.