rzo1 commented on PR #220:
URL: https://github.com/apache/openjpa/pull/220#issuecomment-6341764408
@ilgrosso thanks for testing. The converter is fine and matches yours. The
difference is in `META-INF/spring-orm.xml`, which maps `plainAttrs` again as
```xml
<basic name="plainAttrs">
<column column-definition="jsonb"/>
</basic>
```
The first fix only handled annotations. When OpenJPA read a `<column>` for a
collection field from a mapping file, it put the column on the list elements
instead of on the field. A list converted by an `AttributeConverter<List<X>,
String>` has no element columns, so mapping failed with the error you saw. A
`<column>` inside `<basic>` is now used for the field itself.
`TestConvertedListXml` covers this with a mapping file like the one in Syncope.
There is one more change needed on your side. The fields are declared
`private final List<PlainAttr> plainAttrs`. JPA does not allow persistent
fields to be `final`, and the OpenJPA enhancer skips them. With annotations
only, the field is not persisted and no error is raised. With the `<basic>`
entry the field is persistent at runtime but missing from the enhanced class,
so the first `persist()` fails in `pcProvideField`.
Could you remove `final` from `plainAttrs` in `JPAAnyObject`, `JPAGroup`,
`JPAUser`, `JPALinkedAccount` and `JPARealm`, rebuild against the current head
of `OPENJPA-3017`, and try again?
--
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]