rzo1 opened a new pull request, #299: URL: https://github.com/apache/openjpa/pull/299
https://issues.apache.org/jira/browse/OPENJPA-3073 An attribute whose type is not `Serializable` (a final value class, a record, an interface) and has no mapping annotation was not persisted although a `@Converter(autoApply = true)` converter exists for its type: no column, the value was lost, JPQL failed with `No field named ...`, the metamodel had no such attribute. Declared `@Basic`, the persistence unit failed to load. Jakarta Persistence 3.2 ยง3.9: a converted attribute is a basic attribute, and an auto-apply converter applies to all attributes of its target type. The decision whether an unannotated attribute is persistent (`PersistenceMetaDataDefaults`) never consulted the auto-apply registry. It does now, keeping the exceptions of the spec (`@Id`, `@Version`, `@Enumerated`, `@Temporal`, `@Convert(disableConversion = true)` on the attribute; relationships and embeddables have their own strategy). `@Basic` attributes of such a type are accepted too. **Upgrade:** such attributes now get a column. `openjpa.Compatibility=MapAutoApplyConvertedFields=false` (default `true`) restores the 4.1.x mapping; for classes enhanced at build time the enhancer has to see the same setting and the converter (listed in the persistence unit). Documented in the migration considerations and in the Upgrade Notes of `RELEASE-NOTES.html`. New tests in `conversion/autoapply` (16, final class to `String`, record to `Long`, interface type, `disableConversion`, field and property access, `@Embeddable`, metamodel, JPQL with parameters, compat flag) fail on master; full `openjpa-persistence-jdbc` suite passes on Derby, the new tests also on PostgreSQL 18. Merging with #298 (OPENJPA-2944): the Java code merges cleanly; `RELEASE-NOTES.html` (Upgrade Notes) and `migration_considerations.adoc` both add an entry at the same place, keep both. CI: the TCK and Databases workflows were started on this branch; this PR stays a draft until both pass. -- 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]
