• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Criteria For Child One-To-Many Relationship

 
bagus winarno
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have relation one to many table like this
CUSTOMER(ID, NAME, ADDRESS) ONE-TO-MANY ORDER(ID,ID_PRODUCT, DATE)

this is my sql code = "SELECT * FROM CUSTOMER LEFT JOIN ORDER ON CUSTOMER.ID=ORDER.ID WHERE ID_PRODUCT LIKE '001' "
If I use DetachCriteria how I can write the criteria correctly


DetachedCriteria crit = DetachedCriteria.forClass(getDomainClass());

/**How can I write the criteria here**/

crit.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);

Thanks for your help.
menggunakan createCriteria HQL.png
[Thumbnail for menggunakan createCriteria HQL.png]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic