You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "rzo1 (via GitHub)" <gi...@apache.org> on 2026/08/29 17:37:06 UTC

[PR] [OPENJPA-2983] Resolve EXTRACT temporal fields by constant, not by name [openjpa]

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

   `CriteriaBuilderImpl.extract()` derived the `DateTimeExtractField` from `field.toString().toUpperCase(...)`. `Locale.ROOT` on master closed the Turkish-locale hole, but the lookup still depended on the exact wording of the spec constants, and an unrecognised field failed with `Enum.valueOf`'s "No enum constant ..." rather than anything actionable.
   
   The `LocalDateField` / `LocalTimeField` / `LocalDateTimeField` constants are now mapped to their `DateTimeExtractField` equivalents by identity, and anything else is rejected with a meaningful message. Identity is safe: the three classes have a single private constructor, are not `Serializable`, and expose no factory.
   
   No behaviour change for working queries — `LocalDateTimeField.DATE`/`TIME` already threw `IllegalArgumentException` (their `toString()` is lowercase, so `valueOf` never matched) and still do, with a better message.
   


-- 
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: dev-unsubscribe@openjpa.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [OPENJPA-2983] Resolve EXTRACT temporal fields by constant, not by name [openjpa]

Posted by "rzo1 (via GitHub)" <gi...@apache.org>.
rzo1 merged PR #166:
URL: https://github.com/apache/openjpa/pull/166


-- 
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: dev-unsubscribe@openjpa.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org