-->
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: Use of subselect in <set>
PostPosted: Thu Feb 01, 2007 8:33 pm 
Beginner
Beginner

Joined: Wed Oct 29, 2003 10:43 am
Posts: 38
Location: Chicago
<class name="net.gainsystems.common.clientserverbatch.hibernate.purchase.order.quote.PoDetailQuote" table="PO_DETAIL_QUOTE">
<composite-id>
<key-property column="TRACKING_NUMBER" length="22" name="trackingNumber" type="long"/>
<key-property column="LINE_NUMBER" length="8" name="lineNumber" type="integer"/>
<key-property column="SPLIT" length="8" name="split" type="integer"/>
</composite-id>

<version column="hibernate_version" name="hibernateVersion" type="long" unsaved-value="null"/>
<property column="ITEM_NUMBER" length="65" name="itemNumber" type="string"/>

<set name="locationSetByItemNumber"
lazy="true"
inverse="true"
cascade="none">
<subselect>
Select
loc_no
From Skul skul left join Skul2 skul2
WHERE skul2.stock_ind != 'N'
AND skul.item_no = item_number
GROUP By locationNumber
</subselect>

<property name="locationNumber" column="loc_no"/>
<synchronize table="skul"/>
<synchronize table="skul2"/>



<key column="loc_no"/>
<many-to-many
class="net.gainsystems.common.clientserverbatch.hibernate.skul.Location">

</many-to-many>
</set>

how would i access the loc_no from the subselect and create a many-to-many read-only collection based on the the class property itemNumber

I know this is ugly, but it is what i have to work with

Location:
<hibernate-mapping>
<class name="net.gainsystems.common.clientserverbatch.hibernate.skul.Location"
table="Location">
<id column="loc_no" name="locationNumber" length="8" type="string">
<generator class="assigned"/>
</id>
<property column="loc_name" length="28" name="locationName" type="string"/>
</class>
</hibernate-mapping>

_________________
LET IT BE :)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 02, 2007 3:55 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ask such questions in the user forum; it ain't tools releated.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 02, 2007 10:27 am 
Beginner
Beginner

Joined: Wed Oct 29, 2003 10:43 am
Posts: 38
Location: Chicago
sorry max i moved it.ps thanks for all your hints and help

_________________
LET IT BE :)


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.