Hi guys
I need help on creating a detached criteria which will use alias (with inner join) only if the aliased object is not null.
in criteria i am using LEFT_OUTER_JOIN, but this argument is not available in detached criteria. Is there any way, besides to do it in detached criteria ?
Code:
criteria.createAlias("element", "alias", JoinFragment.LEFT_OUTER_JOIN);
Criterion criterion1= Restrictions.isNull("element");
Criterion criterion2= Restrictions.eq("alias.something", false);
criteria.add(Restrictions.or(criterion1, criterion2));
thanks