rzo1 opened a new pull request, #334:
URL: https://github.com/apache/openjpa/pull/334

   https://issues.apache.org/jira/browse/OPENJPA-3103
   
   A fully qualified enum literal of a nested enum failed to parse:
   
   ```
   SELECT e FROM NaturalNumber e WHERE e.numType = 
ee.jakarta.tck.data.framework.read.only.NaturalNumber.NumberType.PRIME
   -- Attempt to query field "ee.jakarta...PRIME" from non-entity variable "ee"
   ```
   
   `JPQLExpressionBuilder.getPathOrConstant` loaded the dotted name as a class, 
which fails for the binary name `Outer$Inner` of a nested class, and then 
resolved the expression as a path.
   
   - Unless the path starts with a variable whose type has a field named like 
the second element, the nested class names are tried (`pkg.Outer$Inner`, 
`pkg$Outer$Inner`, ...). Top-level class names resolve as before.
   - `JPQL.jjt`: an IN list accepts enum literals (`e.numType IN (pkg.Enum.A, 
pkg.Outer.Inner.B, :p)`), also for top-level enums. An IN item that is a path 
but no constant fails with `not-in-literal`.
   - The `no-field` message got its arguments in the wrong order.
   
   Tests: `TestNestedEnumLiteral` (nested and doubly nested literals, the 
Jakarta Data TCK shape, bulk UPDATE, IN/NOT IN with literals and parameters, an 
alias named like the first package segment, error messages) and IN cases in 
`TestEnumsInJPQL`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to