I had tested my case with a sql profiler prior posting and querying (hql + 
.List<Lot>) my "Lot" class mapped as shown. It does not issue any left join 
on LOT_INDICATEUR. Without having to specify lazy attribute.
But the call to IQuery.List<Lot>() does indeed issue at once a list of 
select on lot_indicateur after the select on Lot, which is clearly not 
lazy. My apologies for that, I had only check that the LotIndicateur 
loading was "looking separated" in sql profiler, not that it was really 
occuring only on access to its corresponding property on Lot.

(On my real code it does not cause any issue though, since my real HQL 
does purposely a "left join fetch lot.Indicateurs", which I had removed for 
looking which queries would then be issued in sql profiler.)

So I have no solution for avoiding any kind of access on the "child" table 
of the one-to-one relationship, when accessing a "master" entity, sorry.
(Mapping that as collections looks to me as a bit too convoluted for 
achieving your desired loading behavior. Too far from "keep it simple" 
principle)

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to