It's not fixed at least in version 4.2.16.Final However you can use an ugly trick and instead of using the regular InExpression provided by Hibernate use a custom one that is aware of this issue and return an always true condition to be placed in the incorrect term. Use it at your own risk, it has saved my day.
public class JoinInManyToManyLeftOuterExpression extends InExpression {
private static final long serialVersionUID = 6647699636659152584L; private int callTimes = 0; private final static String skipperExpression = "1=1";
public JoinInManyToManyLeftOuterExpression(String propertyName, Object[] values) { super(propertyName, values); }
@Override public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException { callTimes++; if (callTimes % 2 != 0) { return skipperExpression; }
else { return super.toSqlString(criteria, criteriaQuery); }
}
}
|