I want to use the Criteria API to select entities by taking the input from a search value. A document can have more recipients. A recipient has many subclasses
The following should work:
Criteria c = session.createCriteria(Document.class, "document");
c.createAlias("document.recipients", "recipient");
c.add(Restrictions.in("recipient.class", Arrays.asList(SubClass1.class,
SubClass2.class,
SubClass3.class)));
c.add(Restrictions.eq("recipient.name", theName));