Vardan Gupta
Vardan Gupta

Reputation: 3595

How we can include/alternate "ON" keyword in JPQL

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

Answers (1)

DataNucleus
DataNucleus

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

Related Questions