• 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?
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!