-->
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: Many-to-one problem
PostPosted: Wed Dec 16, 2009 11:37 pm 
Newbie

Joined: Thu Dec 10, 2009 7:52 pm
Posts: 2
I have a class with the property

Quote:
class
name="BatchDuplicateCheckInformation"
table="T_CHECK"
schema="NSS">
<id
name="OId"
type="long">
<column
name="OID"
scale="0" />
</id>
<set
name="names"
lazy="false">
<key
column="SUBJECT_ID"/>
<one-to-many
class="SubjectName"/>
</set>

and the object has a Collection<SubjectName> names with relevant getter/setter. this work well and retuens a set of all the subject associated with the check but I want to change this to a single object of type SubjectName name='primaryName' by essentially adding a where cause of NAME_TYPE_CODE='PRIM' and changing to many-to-one or one-to-one or property and the relevant changes to the object.
But different attempts at this have failed as the <formula> seems to work on a <properties> or composite key.
The primary ket on the T_SUBJECT_NAME is OID and the foreign key is SUBJECT_ID, there is a column of NAME_TYPE_CODE
Any sugestions most welcome.


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.