Ability to use parametrized type as AttributeConverter type parameter

Description

Implementations of AttributeConverter<X<Z>, Y> fail in Hibernate 4.3.0.Final (with hibernate-jpa-2.1-api 1.0.0.Final).

The following declaration fails:

But this one works:

The exception is

And it occurs occurs in AttributeConverterDefinition.java:67:

where the real type is ParameterizedTypeImpl, probably because Set<Category> is more complex than just Set.

Environment

Java SE 7, Tomcat 7.0.47, MySQL 5.6

Activity

Show:
Steve Ebersole
May 26, 2015, 9:13 PM

That or you could have tried a SNAPSHOT. Anyway, tomorrow is the next release so you might as well wait And it will be CR1, not Beta3

Nick Davies
May 21, 2015, 1:34 PM

Hi Jörg - Steve Ebersole made changes and closed this issue after the release of 5.0.0.Beta2 - we will have to wait for the release of Beta3 to try them out.

Regards,

Nick.

Jörg Hohwiller
May 21, 2015, 1:22 PM

Can someone confirm and reopen?

Jörg Hohwiller
May 21, 2015, 1:20 PM

Same here: I get this error with 5.0.0.Beta2 and it worked with 4.3.8.
As I stated in HHH-8854 and HHH-8958 dealing with java reflection is painful. Use a proper highlevel library for that to avoid such ugly bugs. If you do not want to depend on third party create your own but be warned that this is a lot of effort and you might want to more or less copy from mmm or guava.

Nick Davies
May 11, 2015, 8:23 AM

Yep, just to confirm - I still get the same error with 4.3.9.Final and 5.0.0.Beta2

Fixed

Assignee

Steve Ebersole

Reporter

A

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major