[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4275) Method in entity with return type of ArrayList<Object[]> causes failure to build session factory
Xavier Poinsard (JIRA)
noreply at atlassian.com
Tue Oct 19 10:34:48 EDT 2010
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=38811#action_38811 ]
Xavier Poinsard commented on HHH-4275:
--------------------------------------
More annoying, it seems to ignore @Transient annotation since the following method causes the problem :
@Transient
public Set<Integer>[] getTerminalIds() {
return null;
}
> Method in entity with return type of ArrayList<Object[]> causes failure to build session factory
> ------------------------------------------------------------------------------------------------
>
> Key: HHH-4275
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4275
> Project: Hibernate Core
> Issue Type: Bug
> Components: annotations
> Affects Versions: 3.5.3
> 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.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list