I had a similar problem. I had a SiebelUser DAO. Each SiebelUser is associated with a team in which there are many relationships. Some SiebelUser had userid = 0 as a foreign key, for which the primary key was not present in the Users table. Therefore, naturally, the selection from the SeibelUsers table ignored users with the identifier userd = 0. This was an earlier configuration
<many-to-one name="teamid" class="com.hewitt.wlm.pojo.Tblteams"> <column name="TEAMID" length="4" not-null="true" /> </many-to-one>
So, To solve my problem, I changed the configuration to. But that did not work for me.
<many-to-one name="teamid" class="com.hewitt.wlm.pojo.Tblteams" **fetch="join" not-null="false" lazy="proxy" not-found="ignore"**> <column name="TEAMID" length="4" not-null="**false**" /> </many-to-one>
Finally, I modified my query to explicitly make the left outer join in such a way as to specify the path from the SiebelUsers table to Users.
select property1, property2, ... from from **SiebelUser s left outer join s.team t** where property1='x'
It worked for me.
Notice that in my SiebelUser class there was a Team object as its property (as defined in the path above). Hope this helps someone.
source share