-->
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: how to map collection using subselect?
PostPosted: Sat Sep 30, 2006 1:48 am 
Newbie

Joined: Tue Jun 06, 2006 11:20 am
Posts: 2
the subselect does not seem to work in the part of this mapping. i think i may have misunderstood how to use this attribute.

Code:
<set name="foo" inverse="true" order-by="DBID" batch-size="30"  subselect=" where MOD(SOMECOL,5)=0 " >
<key> <column name="SOMEID" precision="22" scale="0" not-null="true" /></key><one-to-many class="Entity" /></set>


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 30, 2006 9:12 pm 
Beginner
Beginner

Joined: Fri Jun 02, 2006 1:23 am
Posts: 27
Instead of using the "subselect" attribute, which i don't see in the docs, try the "where" clause.
Quote:
where (optional) specify an arbitrary SQL WHERE condition to be used when retrieving or removing the collection (useful if the collection should contain only a subset of the available data)


So it should be like,
Code:
<set name="foo" ...  where="MOD(SOMECOL,5)=0" >

_________________
George F.
Don't forget to rate!


Top
 Profile  
 
 Post subject: solution
PostPosted: Sat Sep 30, 2006 10:57 pm 
Newbie

Joined: Tue Jun 06, 2006 11:20 am
Posts: 2
yup that was it.

georgef wrote:
Instead of using the "subselect" attribute, which i don't see in the docs, try the "where" clause.
Quote:
where (optional) specify an arbitrary SQL WHERE condition to be used when retrieving or removing the collection (useful if the collection should contain only a subset of the available data)


So it should be like,
Code:
<set name="foo" ...  where="MOD(SOMECOL,5)=0" >


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.