File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Hibernate Criteria For Child One-To-Many Relationship Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate Criteria For Child One-To-Many Relationship" Watch "Hibernate Criteria For Child One-To-Many Relationship" New topic
Author

Hibernate Criteria For Child One-To-Many Relationship

bagus winarno
Greenhorn

Joined: Apr 29, 2013
Posts: 2
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.


[Thumbnail for menggunakan createCriteria HQL.png]

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate Criteria For Child One-To-Many Relationship