This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Hibernate Criteria Could not understand Left Join Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate Criteria Could not understand Left Join "ON" condition-- HELP" Watch "Hibernate Criteria Could not understand Left Join "ON" condition-- HELP" New topic
Author

Hibernate Criteria Could not understand Left Join "ON" condition-- HELP

monika se
Greenhorn

Joined: Mar 23, 2011
Posts: 22
Hi,
I have a Query on 2 tables A,B as below:

This query is returning correct result on Database.
select A.id, B.id from Apple A left join Ball B on A.id= B.aId where A.categoryId = 23 order by B.phone ;

In Database, for each category, We have many records in A table. And corresponding to each entry in A table, We may/may not have a unique entry in table B.
Need to fetch all records that are in A and are associated/not associated with Table B for that categoryId. When we do not find any record for B, make it as blank/null. Basically I want distinct entry left outer join.

When I am using it in Hibernate Criteria Class, on keyword is not recognized. And so not able to use it. Please suggest a way out to implement it.
Thanks.
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1


How are you specifying the JOIN condition with Criteria?

Cheers,
Raj.
 
Don't get me started about those stupid light bulbs.
 
subject: Hibernate Criteria Could not understand Left Join "ON" condition-- HELP