Thanks for the responses. I see the use of the disjunction but am not being able to follow as to how it can be used for the child parts without creating a second criteria.
Code:
Disjunction d = Restrictions.disjunction();
d.add(Restrictions.like("description","F%"));
d.add(Restrictions.like("name", "F%"));
[b] d.add(Restrictions.like("parts.name", "F%")); [/b]
The code in bold will not work. I am missing something wherein I need to add a criteria for parts.
In short, the query:
select * from car c where c.name like 'F%' or c.description like 'F%' or c.id in (select p.carId from parts p where p.description like 'F%');
is what I am trying to build.