Make a bidirectional property anchor in a "Player" class that doesn't cascade anything...
hmm, something like this:
Code:
<many-to-one name="Team" column="TeamId" class="Team" cascade="none" not-null="false" />
so, when u load list of "Teams", in each have an list of "Players" that will have an object reference do "Team". i gess u get it...
and, in hql, if u want to list a "Players" without a team. try that:
Code:
from Player player where player.Team is null
Rapid tip: Try not use cascade="all" in "child" classes, because, the hibernate will generate "update" statments to update your "father" classes....
check it <many-to-one name="UserID" class="User" cascade="all" lazy="false" column="UserID"/>
use cascade="none" if the intention is only relationship, not commit all "relation" data... =)
cya