Is it possilble in Hibernate Criteria API add a condition after "on" clause in join? I wolud like to get a query like this:
Code:
Select * from Task t
left join Attribute a
on t.task_id = a.att_task_id
and a.att_name = 'something'
where ...
So I wrote criteria:
Code:
DetachedCriteria dc = DetachedCriteria.forClass(Task,"t");
dc.createAlias("Attribute", "a");
dc.setFetchMode("Attribute", FetchMode.JOIN);
dc.add(Restrictions.eq("a.att_name", "something"));
But query which I get is:
Code:
Select * from Task t
join Attribute a
on t.task_id = a.att_task_id
where
a.att_name = 'something'
Colud somebody help me whit this problem ?