Reputation: 3595
I have two tables where I want to have left join, my query looks following
SELECT * FROM BP_USER a LEFT JOIN BP_USER_BUSINESS b ON a.bpin = b.bpin;
When I tried to include ON in jpql, it raises an exception, kindly share the way to achieve it.
Upvotes: 0
Views: 223
Reputation: 15577
Obviously that is SQL not JPQL, there is no asterisk in JPQL. Similarly "ON" clauses on joins is only present in JPA2.1 and not in earlier versions. Some implementations (like DataNucleus JPA) already provide this, but yours maybe doesn't. If you're limited to an implementation which doesn't allow it yet then you have to put the ON clause into the WHERE clause of the JPQL
Upvotes: 1