[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4275?page=c...
]
Emmanuel Bernard updated HHH-4275:
----------------------------------
Summary: Avoid chocking on weird types when property is marked as transient /
@Transient (was: Method in entity with return type of ArrayList<Object[]> causes
failure to build session factory)
Collections of collections in general are not supported in Hibernate. But the transient
field should not cause issue.
Avoid chocking on weird types when property is marked as transient /
@Transient
-------------------------------------------------------------------------------
Key: HHH-4275
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4275
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.2.0
Environment: Hibernate 3.2.X, no database needed (happens during factory build
before connecting to db)
Reporter: Clint Popetz
Attachments: propertyTypeExtractorBug.tar.gz
The following source:
@javax.persistence.Entity
public class TestEntity {
@javax.persistence.Id
public int Id;
public java.util.ArrayList<Object[]> badMethod() { return null; }
public static void main(String args[]) {
new
org.hibernate.cfg.AnnotationConfiguration().addAnnotatedClass(TestEntity
.class).configure().buildSessionFactory();
}
}
will cause:
java.lang.IllegalArgumentException: No PropertyTypeExtractor available for type void
at
org.hibernate.annotations.common.reflection.java.JavaReflectionManager.toXType(JavaReflectionManager.java:164)^M
at
org.hibernate.annotations.common.reflection.java.JavaXMethod.create(JavaXMethod.java:18)
at
org.hibernate.annotations.common.reflection.java.JavaReflectionManager.getXMethod(JavaReflectionManager.java:128)
at
org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredMethods(JavaXClass.java:114)
at org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:214)
at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:133)
at
org.hibernate.validator.event.ValidateEventListener.initialize(ValidateEventListener.java:91)
at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:356)
at org.hibernate.cfg.Configuration.getInitializedEventListeners(Configuration.java:1304)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
Changing the return type to List<Object[]> avoids the bug.
Attached is a tgz of an ant-buildable project; typing "ant run" will illustrate
the bug.
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira