-->
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: use of subselect in <set>
PostPosted: Fri Feb 02, 2007 10:26 am 
Beginner
Beginner

Joined: Wed Oct 29, 2003 10:43 am
Posts: 38
Location: Chicago
ass 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 10:55 am 
Beginner
Beginner

Joined: Wed Oct 29, 2003 10:43 am
Posts: 38
Location: Chicago
i would be willing to use bag or any other collection hibernate supports

_________________
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.  [ 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.