Joined: Mon Mar 26, 2007 5:26 am Posts: 10
|
Hey all
I am using the following HQL statement to retrieve a movie and its 'tags' collection.
from Movie m inner join fetch m.tags
The problem is that when the collection is loaded all of the associated objects of the collection also are loaded.
Movie.hbm.xml
<set name="tags" cascade="all">
<key column="movie_id" />
<one-to-many class="com.example.model.Tag" />
</set>
Tag.hbm.xml
<many-to-one
name="user"
column="user_id"
not-null="true"
/>
<many-to-one
name="movie"
column="movie_id"
not-null="true"
/>
What I don't want is Hibernate loading the user and movie properties for the 'tag' collection when issuing the HQL statement, is it possible to only populate certain properties of associated collections?
Thanks!
|
|