JPA 2 metamodel impl ignores nested generics

Description

Envers' VersionsJoinTableRangeComponentNamingTest shows the problem.

Environment

None

Activity

Show:
Emmanuel Bernard
January 15, 2010, 12:53 PM

java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.Class
at org.hibernate.ejb.metamodel.AttributeFactory$PluralAttributeMetadataImpl.<init>(AttributeFactory.java:736)
at org.hibernate.ejb.metamodel.AttributeFactory$PluralAttributeMetadataImpl.<init>(AttributeFactory.java:711)
at org.hibernate.ejb.metamodel.AttributeFactory.determineAttributeMetadata(AttributeFactory.java:506)
at org.hibernate.ejb.metamodel.AttributeFactory.buildAttribute(AttributeFactory.java:83)
at org.hibernate.ejb.metamodel.AttributeFactory.getMetaModelType(AttributeFactory.java:213)
at org.hibernate.ejb.metamodel.AttributeFactory.buildAttribute(AttributeFactory.java:92)
at org.hibernate.ejb.metamodel.MetadataContext.wrapUp(MetadataContext.java:177)
at org.hibernate.ejb.metamodel.MetamodelImpl.buildMetamodel(MetamodelImpl.java:66)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:79)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:752)
at org.hibernate.envers.test.AbstractEntityTest.init(AbstractEntityTest.java:94)
at org.hibernate.envers.test.AbstractEntityTest.init(AbstractEntityTest.java:82)

Emmanuel Bernard
January 15, 2010, 8:45 PM

Note that we can't move to the XLayer as am embeddable type is not read in the context of it's owning entity and thus would limit the scope.
As a workaround, we now return the first upper bound

Steve Ebersole
March 21, 2011, 7:09 PM

Bulk closing stale resolved issues

Fixed

Assignee

Emmanuel Bernard

Reporter

Emmanuel Bernard

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure