the problem is to get mapped entity by few search criterias where one or more from them related to member types/collection members of this top level element
the aswer is to use "Criteria" and also add criteria to member of top level entity by calling criteria.createCriteria(member object/collection name) :
Criteria cr = getSession().createCriteria(Some_DT.class).setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
cr.add(Restrictions.in(member_name, some_collection));
cr.add(Restrictions.ge(member_name, some_value));
cr.add(Restrictions.le(member_name, some_value));
cr.add(Restrictions.in(member_name, some_collection));
cr.createCriteria(member object/collection name).add(Restrictions.like(child member->member name, "%"+some value+"%"));
неплохой пост описывающий ту же ситуацию : http://lucker.intervelopers.com/java/cc_join/
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment