• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 451
1
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

How are you specifying the JOIN condition with Criteria?

Cheers,
Raj.
 
He was expelled for perverse baking experiments. This tiny ad is a model student:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic