Thirukumaran
Thirukumaran

Reputation: 367

How to Join two tables in HQL,which doesn't have relationship in Database

Could you please let me know will it possible to have a join in HQL hibernate, which doesn't have any table relationship in Database?

Upvotes: 0

Views: 560

Answers (1)

jpprade
jpprade

Reputation: 3664

You can make a cartesian join with a condition in the where like this :

select e1.id,e2.id from Entity1 e1, Entity2 e2 where e1.fieldX=e2.fieldY

Upvotes: 0

Related Questions