[ 
https://issues.apache.org/jira/browse/OPENJPA-3103?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Maxim Solodovnik resolved OPENJPA-3103.
---------------------------------------
    Fix Version/s: 4.3.0
         Assignee: Richard Zowalla
       Resolution: Fixed

> Fully qualified enum literal whose package starts like an identifier is 
> parsed as a path ("non-entity variable")
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-3103
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-3103
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 4.2.0
>            Reporter: Richard Zowalla
>            Assignee: Richard Zowalla
>            Priority: Major
>             Fix For: 4.3.0
>
>
> JPQL with a fully qualified enum literal whose package starts with a name 
> that could be an identification variable fails to parse:
> {noformat}
> SELECT e FROM NaturalNumber e WHERE e.isOdd = false AND e.numType = 
> ee.jakarta.tck.data.framework.read.only.NaturalNumber.NumberType.PRIME
> {noformat}
> {noformat}
> An error occurred while parsing the query filter "SELECT e FROM NaturalNumber 
> e WHERE e.isOdd = false AND e.numType = 
> ee.jakarta.tck.data.framework.read.only.NaturalNumber.NumberType.PRIME".
> Error message: Attempt to query field 
> "ee.jakarta.tck.data.framework.read.only.NaturalNumber.NumberType.PRIME" from 
> non-entity variable "ee". Perhaps you forgot to prefix the path in question 
> with an identification variable from your FROM clause?
> {noformat}
> The literal is a nested enum (NaturalNumber.NumberType, a member of the 
> entity class) in the package ee.jakarta.tck.data.framework.read.only. The 
> parser resolves the first segment "ee" as a variable instead of treating the 
> whole path as an enum literal (Jakarta Persistence: "An enum literal is 
> written using its fully qualified name"). EclipseLink accepts the query.
> Found with the Jakarta Data 1.0 TCK 
> (EntityTests#testLiteralEnumAndLiteralFalse, assertion #458) on Apache TomEE 
> 11 Plus, which uses OpenJPA; Jakarta Data repositories pass JDQL enum 
> literals through to the provider this way.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to