-->
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: Many-to-one Question
PostPosted: Fri Feb 12, 2010 4:51 pm 
Newbie

Joined: Fri Feb 12, 2010 4:42 pm
Posts: 1
<many-to-one name="vendor" class="VendorParty" column="vendor_party_id"/>

<many-to-one name="incentive" class="Incentive" insert="false" update="false">
<column name="incentive_nm"/>
<column name="vendor_party_id"/>
</many-to-one>

<many-to-one name="parentIncentive" class="Incentive" insert="false" update="false">
<column name="parent_incentive_nm"/>
<column name="vendor_party_id"/>
</many-to-one>

The issue I am running into, is that I am trying to save the value in the vendor_party_id column in the first clause. But I also need to save the incentive_nm and parent_incentive_nm to the database in the second and third clause. The vendor_party_id is needed in both the second and third clause because the Incentive class is a composite key of the incentive_nm and the vendor_party_id.

So how do I set the incentive_nm and parent_incentive_nm column to be inserted and updated = true but have the vendor_party_id not be inserted or updated except in the first clause?

If anyone has any suggestions I would appreciate it.


Top
 Profile  
 
 Post subject: Re: Many-to-one Question
PostPosted: Sat Feb 13, 2010 6:32 pm 
Beginner
Beginner

Joined: Wed Nov 21, 2007 8:02 am
Posts: 48
1) Remove the insert="false" and update="false" from the many-to-ones

2) use <formula>vendor_party_id<formula> for the last two many-to-ones


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.