criteria.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
I've used this to solve bit, but found another problem... my nested "OR" set isnt working properly.
here is my code.
Code:
criteria.add(Expression.or(Expression.or(Expression.or( Expression.ilike("firstName", query, MatchMode.ANYWHERE), Expression.ilike("lastName", query, MatchMode.ANYWHERE)),
Expression.ilike("login", query, MatchMode.ANYWHERE) ),
Expression.ilike("email", query, MatchMode.ANYWHERE)));
Also whats the differnece between Expression and Restriction?