I am trying to create a detached criteria that has an OR restriction
DetachedCriteria subquery = DetachedCriteria.forClass(Component.class);
subquery.createCriteria("review").add(Restrictions.eq("owner", user));
subquery.createCriteria("review").createCriteria("observers").
add(Restrictions.eq("id", user.getId()));
so bascially I need to put the Restriction.or for the second and third line of the code above, however the Restriction.or does not except DetachedCritera. So I need to do something like this
Restrictions.or(
subquery.createCriteria("review").add(Restrictions.eq("owner", user)),
subquery.createCriteria("review").createCriteria("observers").
add(Restrictions.eq("id", user.getId()));
However this wont compile. So how do I achieve this? Any suggestions?
Thanks in advance. cheers