[
https://issues.apache.org/jira/browse/OPENJPA-2944?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18141812#comment-18141812
]
ASF subversion and git services commented on OPENJPA-2944:
----------------------------------------------------------
Commit d393f651a67aad74159182e0f58c18b738d7e306 in openjpa's branch
refs/heads/OPENJPA-2944 from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=d393f651a ]
[OPENJPA-2944] Auto apply converters of parameterized attribute types and warn
about competing ones
An auto apply converter whose attribute type is parameterized, such as
AttributeConverter<Box<String>, String>, was not registered, because the scan
only accepted a plain class, while a converter given by @Convert resolves the
same type to its raw class. Such a converter is now registered under the
erased attribute type, so the attribute gets the converter's column type
instead of a serialized BLOB.
As converters whose types come from a generic superclass or from an interface
extending AttributeConverter are now recognised, more than one auto apply
converter may be found for an attribute type. The repository logs a warning
when one replaces another.
Note on upgrading: attributes converted by such converters were mapped as a
serialized BLOB (BYTEA on PostgreSQL) before and now map to the converter's
database type. Existing columns and data need to be migrated, or the old
mapping kept with an explicit column definition.
> Inconsistent column type conversion when using AttributeConverter
> -----------------------------------------------------------------
>
> Key: OPENJPA-2944
> URL: https://issues.apache.org/jira/browse/OPENJPA-2944
> Project: OpenJPA
> Issue Type: Bug
> Components: jdbc
> Affects Versions: 4.1.0
> Environment: Postgresql
> Reporter: Guenter Windsperger
> Priority: Minor
>
> When using an AttributeConverter the resulting expression is always of type
> `bytea` instead of the respective declared converter type e.g. bigint for
> Long.
> This can be observed with the existing Test `TestExternalValues`, where both
> UUID properties, one converted with the custom Externalizer API, the other
> with the standard Converter API, produce different column types.
> I am happy to provide some PR if someone could point me to the potential root
> cause.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)