[ 
https://issues.apache.org/jira/browse/OPENJPA-2944?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18141811#comment-18141811
 ] 

ASF subversion and git services commented on OPENJPA-2944:
----------------------------------------------------------

Commit 615b6706fc996b40156b81a5196a231f761987c0 in openjpa's branch 
refs/heads/OPENJPA-2944 from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=615b6706f ]

[OPENJPA-2944] Take the column type of a converted attribute from a generic 
converter hierarchy

The database type of an AttributeConverter, the Y in AttributeConverter<X, Y>,
was only found when a class in the converter's superclass chain implemented
AttributeConverter with concrete type arguments. A converter that extends a
generic base class such as Base<X, Y> implements AttributeConverter<X, Y>, or
that implements an interface extending AttributeConverter, resolved to Object.
Its attribute was then mapped as a serialized object, a BLOB (BYTEA on
PostgreSQL) instead of, for instance, a BIGINT for a Long, and an auto applied
converter of that kind was not registered at all.

The type arguments are now resolved through the whole type hierarchy, binding
the type variables of generic supertypes to the arguments their subtypes pass.
The auto apply scan uses the same resolution.


> 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)

Reply via email to