Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Joe Ess
  • salvin francis
  • fred rosenberger

Hibernate 2: Write hql query to join 3 unrelated classes

Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a newbie and having trouble writing a query to join 3 unrelated classes ClassA, ClassB, ClassC.
Here are the details (and I will show in code below).. ClassA has long attribute that will match the id of ClassB (but the id of ClassB is Long). ClassB has attribute of type ClassC. ClassC has attribute of type string.
Here is the code:

here are the hbm relevant lines:
ClassA hbm:

ClassB hbm:

ClassC hbm:

I want to get all objects of ClassA where and ClassB.classC=ClassC and"abc"

Message for you sir! I think it is a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!