Hi All,
I am relatively new to hibernate and having a few problems with implementing criteria.
I want a query smiliar to: FROM T1 WHERE (x=1 and x2=1) OR (y=1 and y2=1).
Code:
List test = session.createCriteria(T1.class)
.add(Expression.and(
Expression.eq("", x),
Expression.eq("", x2
))
.add(Expression.or(
Expression.eq("", y),
Expression.eq("", y2)
)).list();
This generates the query: FROM T1 WHERE (x=1 and x2=1) AND (y=1 and y2=1).
How can i change the code to expression the OR statement?
Thanks