How compare the same entity in JPQL ?

M

marek

I've got some entity and I want to compare values from the same one in JPQL.
For example: SELECT i1 FROM Items i1, Items i2 WHERE i1.data = ?1 AND
i2.data = ?2, it works, but I need null values too, so I must use JOIN
(OUTER JOIN).
Items entity doesn't have references to itself.
My question's how can I use JOIN i this JPQL statement ?
 
T

Tris Orendorff

marek said:
I've got some entity and I want to compare values from the same one in JPQL.
For example: SELECT i1 FROM Items i1, Items i2 WHERE i1.data = ?1 AND
i2.data = ?2, it works, but I need null values too, so I must use JOIN
(OUTER JOIN).
Items entity doesn't have references to itself.
My question's how can I use JOIN i this JPQL statement ?

This should help: http://e-docs.bea.com/kodo/docs41/full/html/ejb3_langref.html#ejb3_langref_Joins

--
Tris Orendorff
[ Anyone naming their child should spend a few minutes checking rhyming slang and dodgy
sounding names. Brad and Angelina failed to do this when naming their kid Shiloh Pitt. At some
point, someone at school is going to spoonerise her name.
Craig Stark ]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top