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: OneToMany - Where Clause Question
PostPosted: Wed Dec 29, 2004 5:49 pm 
Newbie

Joined: Wed Dec 22, 2004 4:41 pm
Posts: 2
Mapping documents:
<class name="Filestatus" table="filestatus" >
<id name="filestatusid" type="java.lang.Integer" column="filestatusid" >
<generator class="assigned" />
</id>
<property name="expectedfileid" type="int" column="expectedfileid"
not-null="true" length="11" />
<property name="status" type="java.lang.String" column="status" length="1"
/>
<property name="actualfilename" type="java.lang.String"
column="actualfilename" length="50" />
<!-- Associations -->
</class>
<class name="Expectedfile" table="expectedfiles" >
<id name="fileid" type="java.lang.Integer" column="fileid" >
<generator class="assigned" />
</id>
<property name="mask" type="java.lang.String" column="mask" length="64" />
<property name="providermmid" type="java.lang.String" column="providermmid"
length="12" />
<!-- Associations -->
<set name="fileStatusAsSet" lazy="true" cascade="all">
<key column="expectedfileid"/>
<one-to-many class="Filestatus"/>
</set>
</class>

Query That I am using
select distinct file from com.tagaudit.itag.om.audits.Expectedfile file join file.fileStatusAsSet fileStatus where fileStatus.status = 'L'

Expected result I think
One file record and a list of fileStatus within that record which contains only fileStatus.status = 'L'

Problem
I get one file record, but the fileStatus.status is not restricted to L. I get all the records within.

I dont know what I am doing wrong. Please help !!!

Thanks,
Amit


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.