i have the following classes
@Entity @Inheritance(strategy = InheritanceType.JOINED) public class GenericContent {String columnA ...}
@Entity public class AContent extends GenericContent {String columnB ...} @Entity public class BContent extends GenericContent {String columnB ...} @Entity public class CContent extends GenericContent { String columnC}
i want to search in columnA for all the 3 classes. which is simpel criteria = getSessionFactory().getCurrentSession().createCriteria(GenericContent .class); disjunction.add(Restrictions.ilike("columnA", "foo", MatchMode.ANYWHERE)); criteria.add(disjunction); List<GenericContent> results = criteria.list();
now i want to add a filter for all columnB's. but this is not in the genericContent. and i rather not go by all subclasses one by one.
is there a solution?
ps all pseudocode
|