[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5068) Fix for AttributeFactory class to manage ParameterizedType
Gail Badner (JIRA)
noreply at atlassian.com
Tue Apr 20 18:06:20 EDT 2010
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=36523#action_36523 ]
Gail Badner commented on HHH-5068:
----------------------------------
Please let us know if this is still an issue using 3.5.1. If it is, please attach a runnable test case (Java + mapping) that reproduces this issue.
> Fix for AttributeFactory class to manage ParameterizedType
> ----------------------------------------------------------
>
> Key: HHH-5068
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5068
> Project: Hibernate Core
> Issue Type: Bug
> Components: entity-manager
> Affects Versions: 3.5.0-Final
> Reporter: Romain Rossi
>
> To make org.hibernate.ejb.metamodel.AttributeFactory.PluralAttributeMetadataImpl.getClassFromGenericArgument(Type) works after migrating from 3.3.2.GA to 3.5.0-Final. I have to change the method whith:
> private Class<?> getClassFromGenericArgument(java.lang.reflect.Type type) {
> Class<?> javaType;
> Object unsafeElementType = type;
> if ( unsafeElementType instanceof Class ) {
> javaType = (Class) unsafeElementType;
> }
> else if ( unsafeElementType instanceof TypeVariable ) {
> final java.lang.reflect.Type upperBound = ( ( TypeVariable ) unsafeElementType ).getBounds()[0];
> javaType = getClassFromGenericArgument( upperBound );
> }
> // ADDED TO FIX THE ParameterizedType
> else if ( unsafeElementType instanceof ParameterizedType) {
> javaType = (Class<?>)((ParameterizedType)type).getRawType();
> }
> // END FIX
> else {
> throw new AssertionFailure("Fail to process type argument in a generic declaration. Type: "
> + type.getClass() );
> }
> return javaType;
> }
> Is there an other way to manage the ParameterizedType?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list