-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Bug in MasterDetailTest?
PostPosted: Thu Jul 29, 2004 1:23 pm 
Newbie

Joined: Mon Jul 19, 2004 12:57 pm
Posts: 8
Location: UK
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.