When I have a one-to-many relationship, I can mark a collection as lazy=true, then the collection will not be automatically populated when the object containing the collection is retrieved from the database.
but, if I have a many-to-one relationship ?
Code:
<class name="hibernate.PlayerVO" table="PLAYER">
<id name="id" column="player_id" type="long" unsaved-value="null">
<generator class="sequence"/>
</id>
<many-to-one name="team" class="hibernate.TeamVO" column="team_id" />
</class>
When I retrieve the "Player", the "Team" will be automatically populated!
Can I do a "Lazy Initialization" for a many-to-one relationship?
thanks