Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HQL join for tables not related to each other

 
Unnati Redkar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it that HQL has the limitation that joins between tables cannot be established in a query, which are not related to each other using PK/FK relationship?
If it can be done, can i have a sample example HQL query.

Thanks,
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do it in the same way you can do this in SQL:

That being said, why join unrelated entities? If they are not related, why write a query that treats them as if they are?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic