Instead of hibernate performing the join simply on the participantId:
Code:
select
corporatel0_.participantId as particip1_,
corporatel0_.type as type2_,
corporatel0_.name as name2_,
corporatel0_.address as address2_,
corporatel0_.city as city2_,
corporatel0_.state as state2_,
corporatel0_.country as country2_,
corporatel0_.zip as zip2_,
corporatel0_1_.status as status3_
from
participant corporatel0_ inner join corporatelocation corporatel0_1_
on corporatel0_.participantId=corporatel0_1_.participantId
where
corporatel0_.type=106
and corporatel0_.participantId=?
I would like an additional "status = A" criteria added to join like:
Code:
select
corporatel0_.participantId as particip1_,
corporatel0_.type as type2_,
corporatel0_.name as name2_,
corporatel0_.address as address2_,
corporatel0_.city as city2_,
corporatel0_.state as state2_,
corporatel0_.country as country2_,
corporatel0_.zip as zip2_,
corporatel0_1_.status as status3_
from
participant corporatel0_ inner join corporatelocation corporatel0_1_
on corporatel0_.participantId=corporatel0_1_.participantId
and corporatel0_1_.status='A'
where
corporatel0_.type=106
and corporatel0_.participantId=?
Any help appreciated.