This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • 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