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>
|