I am tracing a problem with the MasterDetailTest unit test. There are test objects called Eye and Jay, with a one-to-many mapping (many Jays refer to one Eye). Therefore this code in Jay looks odd:
Code:
public Jay(Eye eye) {
eye.getJays().add(eye);
this.eye = eye;
}
Shouldn't this be something like:
Code:
public Jay(Eye eye) {
eye.getJays().add(this);
this.eye = eye;
}
??
Right now when I run the test it has an object of type Eye in the set of what it is expecting to be Jays. It then tries to use a getter from the Jay class on an Eye object, and fails:
Code:
Testcase: testOuterJoin took 42.827 sec
Caused an ERROR
IllegalArgumentException occurred calling getter of org.hibernate.test.Jay.id
net.sf.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of org.hibernate.test.Jay.id
at net.sf.hibernate.property.BasicPropertyAccessor$BasicGetter.get(Ljava.lang.Object;)Ljava.lang.Object;(BasicPropertyAccessor.java:114)
at net.sf.hibernate.persister.AbstractEntityPersister.getIdentifier(Ljava.lang.Object;)Ljava.io.Serializable;(AbstractEntityPersister.java:307)
at net.sf.hibernate.proxy.HibernateProxyHelper.getIdentifier(Ljava.lang.Object;Lnet.sf.hibernate.persister.ClassPersister;)Ljava.io.Serializable;(HibernateProxyHelper.java:48)
at net.sf.hibernate.type.EntityType.toString(Ljava.lang.Object;Lnet.sf.hibernate.engine.SessionFactoryImplementor;)Ljava.lang.String;(EntityType.java:85)
at net.sf.hibernate.type.PersistentCollectionType.toString(Ljava.lang.Object;Lnet.sf.hibernate.engine.SessionFactoryImplementor;)Ljava.lang.String;(PersistentCollectionType.java:82)
at net.sf.hibernate.impl.Printer.toString(Ljava.lang.Object;)Ljava.lang.String;(Printer.java:50)
at net.sf.hibernate.impl.Printer.toString(Ljava.util.Iterator;)V(Printer.java:83)
at net.sf.hibernate.impl.SessionImpl.flushEverything()V(SessionImpl.java:2277)
at net.sf.hibernate.impl.SessionImpl.flush()V(SessionImpl.java:2235)
at org.hibernate.test.MasterDetailTest.testOuterJoin()V(MasterDetailTest.java:74)
at jrockit.reflect.NativeMethodInvoker.invoke0(Ljava.lang.Object;ILjava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
at jrockit.reflect.NativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
at org.hibernate.test.TestCase.runTest()V(TestCase.java:84)
Caused by: java.lang.IllegalArgumentException
at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
at net.sf.hibernate.property.BasicPropertyAccessor$BasicGetter.get(Ljava.lang.Object;)Ljava.lang.Object;(BasicPropertyAccessor.java:98)
... 24 more
Versions:
Hibernate 2.1.4
Informix 9.4 UC2 on RedHat
JDBC 2.21JC5
JRockit 1.4.2_04
Thanks,
Marko