| Steve Ebersole I think what happen is the cause by the fact we have both an Event and a Category with the same natural id value. The query
Event event = session.byNaturalId(Event.class).using("code", "1").load();
produce the following SQl
select
event_.id as id1_0_
from
parameter event_
where
event_.code=?
and retrieve the id of the Category with code = 1 then a second query
select
event0_.id as id1_0_0_,
event0_.code as code3_0_0_,
event0_.name as name4_0_0_
from
parameter event0_
where
event0_.id=?
and event0_.type='EVENT-TYPE'
is executed with the event0_.id=? corresponding to the id of the Category retrieved by the first query but the type="EVENT-TYPE" so the result is empty. |