-->
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: Initailizing a set using setFetchMode(FetchMode.JOIN)
PostPosted: Fri Jan 18, 2008 4:17 pm 
Newbie

Joined: Fri Jan 18, 2008 4:06 pm
Posts: 1
I am trying to initialize a set using the following Criteria:

...
crit.setFetchMode("client", FetchMode.JOIN);
crit = crit.createCriteria("searches").add(Restrictions.like("searchString", search));
crit.setFetchMode("searches", FetchMode.JOIN);
...

When I execute the query only client( an association to another object ) has been initialized, not the set of searches. Am I wrong in thinking that the searches set should also be initialized? The SQL certainly indicates that a JOIN is being performed.

The mapping xml is shown below:


<class name="CSO" abstract="true">
<id name="id" column="csoId">
<generator class="native" />
</id>
<many-to-one name="client" column="clientId"/>
<set name="searches" cascade="save-update, delete" >
<key column="csoId" />
<one-to-many class="Search" />
</set>
</class>


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.