Java: JPQL select statement

Posted by bguiz on Stack Overflow See other posts from Stack Overflow or by bguiz
Published on 2010-05-24T23:12:34Z Indexed on 2010/05/24 23:21 UTC
Read the original article Hit count: 291

Filed under:
|
|

select x from X x where x.a.id = :a_id --> Always 0 objects selected

Why does the above JPQL statement not work, but the one below work?

select a from A a where a.id = :a_id --> a_obj
select x from X x where x.a = :a_obj --> Always correct number of objects selected

Neither query throws an exception during execution, but a different number of results are obtained.

Thanks

© Stack Overflow or respective owner

Related posts about java

Related posts about select