|Enum literals in JPQL IN expressions [message #540481]
||Wed, 16 June 2010 10:52
Registered: June 2010
I am trying to use Enum literals in JPQL IN expressions to select all Phones with a specific PhoneType where PhoneType is a Java Enum. The JPQL query is:
SELECT p FROM Phone p WHERE p.type IN (my.package.PhoneType.Home, my.package.PhoneType.Work)
This results in a Syntax error while parsing the query.
Exception Description: Syntax error parsing the query [nonMobilePhones: SELECT p FROM Phone p WHERE p.type IN (my.package.PhoneType.Home, my.package.PhoneType.Work)], line 1, column 41: syntax error at [.].
Can anyone give me a hint how this query has to be formulated with correct syntax?
Powered by FUDForum
. Page generated in 0.02661 seconds