Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.1.3
Mapping documents:
Code:
<class name="org.akaloo.common.tools.persistence.component.recurse.A" table="TEST_A" proxy="org.akaloo.common.tools.persistence.component.recurse.A">
<id name="id" type="long" column="UID" unsaved-value="null">
<generator class="native"/>
</id>
<version name="version" type="int" column="NO_VERSION" unsaved-value="negative"/>
<property name="val" type="int">
<column name="VAL"/>
</property>
<component name="b" class="org.akaloo.common.tools.persistence.component.recurse.B">
<property name="valB" type="int">
<column name="VAL_B"/>
</property>
<component name="c" class="org.akaloo.common.tools.persistence.component.recurse.C">
<property name="valC" type="int">
<column name="VAL_C"/>
</property>
<component name="d" class="org.akaloo.common.tools.persistence.component.recurse.D">
<property name="valD" type="int">
<column name="VAL_D"/>
</property>
<parent name="c"/>
</component>
</component>
</component>
</class>
Code between sessionFactory.openSession() and session.close():Code:
Session s = sessionFactory.openSession();
Transaction tx = s.beginTransaction();
A a = new A();
B b = new B();
C c = new C();
D d = new D();
a.setB(b);
b.setC(c);
c.setD(d);
d.setC(c);
s.save(a);
s.flush();
tx.commit();
s.close();
// Check!
s = sessionFactory.openSession();
tx = s.beginTransaction();
List<A> list = s.createQuery("from " + A.class.getName()).list();
assert list.size() == 1;
A qA = list.get(0);
assert qA.getB().getC().getD().getC().equals(qA.getB().getC()); // Where it goes wrong!
assert qA.getB().getC().getD().getC().equals(qA.getB().getC());
tx.commit();
s.close();
Full stack trace of any exception that occurs:org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of org.akaloo.common.tools.persistence.component.recurse.D.c
at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:104)
at org.hibernate.tuple.PojoComponentTuplizer.setParent(PojoComponentTuplizer.java:142)
at org.hibernate.type.ComponentType.instantiate(ComponentType.java:438)
at org.hibernate.type.ComponentType.resolve(ComponentType.java:524)
at org.hibernate.type.ComponentType.resolve(ComponentType.java:528)
at org.hibernate.type.ComponentType.resolve(ComponentType.java:528)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:116)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
at org.hibernate.loader.Loader.doQuery(Loader.java:717)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2145)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
at org.hibernate.loader.Loader.list(Loader.java:2024)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:308)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:153)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1106)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at org.akaloo.common.tools.persistence.component.recurse.ComponentTest.testTransaction(ComponentTest.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:552)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:407)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:778)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
at org.testng.TestRunner.privateRun(TestRunner.java:682)
at org.testng.TestRunner.run(TestRunner.java:566)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:220)
at org.testng.SuiteRunner.run(SuiteRunner.java:146)
at org.testng.eclipse.runner.RemoteTestNG.run(RemoteTestNG.java:98)
at org.testng.eclipse.runner.RemoteTestNG.main(RemoteTestNG.java:138)
Caused by: java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:42)
Name and version of the database you are using:HSQL DB 1.8.0.4
The generated SQL (show_sql=true):Code:
Hibernate: insert into TEST_A (NO_VERSION, VAL, VAL_B, VAL_C, VAL_D, UID) values (?, ?, ?, ?, ?, null)
Hibernate: call identity()
Hibernate: select a0_.UID as UID0_, a0_.NO_VERSION as NO2_0_, a0_.VAL as VAL0_, a0_.VAL_B as VAL4_0_, a0_.VAL_C as VAL5_0_, a0_.VAL_D as VAL6_0_ from TEST_A a0_
Debug level Hibernate log excerpt:Code:
2007-02-28 17:43:02,097 DEBUG [org.hibernate.impl.SessionImpl] - <opened session at timestamp: 4803301302345728>
2007-02-28 17:43:02,097 DEBUG [org.hibernate.transaction.JDBCTransaction] - <begin>
2007-02-28 17:43:02,097 DEBUG [org.hibernate.jdbc.ConnectionManager] - <opening JDBC connection>
2007-02-28 17:43:02,097 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - <total checked-out connections: 0>
2007-02-28 17:43:02,097 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - <using pooled JDBC connection, pool size: 0>
2007-02-28 17:43:02,097 DEBUG [org.hibernate.transaction.JDBCTransaction] - <current autocommit status: false>
2007-02-28 17:43:02,097 DEBUG [org.hibernate.jdbc.JDBCContext] - <after transaction begin>
2007-02-28 17:43:02,097 DEBUG [org.hibernate.event.def.DefaultSaveOrUpdateEventListener] - <saving transient instance>
2007-02-28 17:43:02,097 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] - <saving [org.akaloo.common.tools.persistence.component.recurse.A#<null>]>
2007-02-28 17:43:02,097 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] - <executing insertions>
2007-02-28 17:43:02,097 DEBUG [org.hibernate.engine.Versioning] - <Seeding: 0>
2007-02-28 17:43:02,112 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - <Inserting entity: org.akaloo.common.tools.persistence.component.recurse.A (native id)>
2007-02-28 17:43:02,112 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - <Version: 0>
2007-02-28 17:43:02,112 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <about to open PreparedStatement (open PreparedStatements: 0, globally: 0)>
2007-02-28 17:43:02,112 DEBUG [org.hibernate.SQL] - <insert into TEST_A (NO_VERSION, VAL, VAL_B, VAL_C, VAL_D, UID) values (?, ?, ?, ?, ?, null)>
Hibernate: insert into TEST_A (NO_VERSION, VAL, VAL_B, VAL_C, VAL_D, UID) values (?, ?, ?, ?, ?, null)
2007-02-28 17:43:02,112 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <preparing statement>
2007-02-28 17:43:02,112 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - <Dehydrating entity: [org.akaloo.common.tools.persistence.component.recurse.A#<null>]>
2007-02-28 17:43:02,128 DEBUG [org.hibernate.type.IntegerType] - <binding '0' to parameter: 1>
2007-02-28 17:43:02,128 DEBUG [org.hibernate.type.IntegerType] - <binding '0' to parameter: 2>
2007-02-28 17:43:02,128 DEBUG [org.hibernate.type.IntegerType] - <binding '0' to parameter: 3>
2007-02-28 17:43:02,128 DEBUG [org.hibernate.type.IntegerType] - <binding '0' to parameter: 4>
2007-02-28 17:43:02,128 DEBUG [org.hibernate.type.IntegerType] - <binding '0' to parameter: 5>
2007-02-28 17:43:02,128 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <about to close PreparedStatement (open PreparedStatements: 1, globally: 1)>
2007-02-28 17:43:02,128 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <closing statement>
2007-02-28 17:43:02,128 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <about to open PreparedStatement (open PreparedStatements: 0, globally: 0)>
2007-02-28 17:43:02,128 DEBUG [org.hibernate.SQL] - <call identity()>
Hibernate: call identity()
2007-02-28 17:43:02,128 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <preparing statement>
2007-02-28 17:43:02,128 DEBUG [org.hibernate.id.IdentifierGeneratorFactory] - <Natively generated identity: 1>
2007-02-28 17:43:02,128 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <about to close PreparedStatement (open PreparedStatements: 1, globally: 1)>
2007-02-28 17:43:02,128 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <closing statement>
2007-02-28 17:43:02,128 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - <flushing session>
2007-02-28 17:43:02,128 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - <processing flush-time cascades>
2007-02-28 17:43:02,128 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - <dirty checking collections>
2007-02-28 17:43:02,128 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - <Flushing entities and processing referenced collections>
2007-02-28 17:43:02,144 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - <Processing unreferenced collections>
2007-02-28 17:43:02,144 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - <Scheduling collection removes/(re)creates/updates>
2007-02-28 17:43:02,144 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - <Flushed: 0 insertions, 0 updates, 0 deletions to 1 objects>
2007-02-28 17:43:02,144 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - <Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections>
2007-02-28 17:43:02,144 DEBUG [org.hibernate.pretty.Printer] - <listing entities:>
2007-02-28 17:43:02,144 DEBUG [org.hibernate.pretty.Printer] - <org.akaloo.common.tools.persistence.component.recurse.A{val=0, b=component[valB,c]{valB=0, c=component[valC,d]{d=component[valD]{valD=0}, valC=0}}, id=1, version=0}>
2007-02-28 17:43:02,144 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - <executing flush>
2007-02-28 17:43:02,144 DEBUG [org.hibernate.jdbc.ConnectionManager] - <registering flush begin>
2007-02-28 17:43:02,144 DEBUG [org.hibernate.jdbc.ConnectionManager] - <registering flush end>
2007-02-28 17:43:02,144 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - <post flush>
2007-02-28 17:43:02,144 DEBUG [org.hibernate.transaction.JDBCTransaction] - <commit>
2007-02-28 17:43:02,144 DEBUG [org.hibernate.impl.SessionImpl] - <automatically flushing session>
2007-02-28 17:43:02,144 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - <flushing session>
2007-02-28 17:43:02,144 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - <processing flush-time cascades>
2007-02-28 17:43:02,144 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - <dirty checking collections>
2007-02-28 17:43:02,144 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - <Flushing entities and processing referenced collections>
2007-02-28 17:43:02,144 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - <Processing unreferenced collections>
2007-02-28 17:43:02,144 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - <Scheduling collection removes/(re)creates/updates>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - <Flushed: 0 insertions, 0 updates, 0 deletions to 1 objects>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - <Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.pretty.Printer] - <listing entities:>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.pretty.Printer] - <org.akaloo.common.tools.persistence.component.recurse.A{val=0, b=component[valB,c]{valB=0, c=component[valC,d]{d=component[valD]{valD=0}, valC=0}}, id=1, version=0}>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - <executing flush>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.jdbc.ConnectionManager] - <registering flush begin>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.jdbc.ConnectionManager] - <registering flush end>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - <post flush>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.jdbc.JDBCContext] - <before transaction completion>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.impl.SessionImpl] - <before transaction completion>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.transaction.JDBCTransaction] - <committed JDBC Connection>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.jdbc.JDBCContext] - <after transaction completion>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.jdbc.ConnectionManager] - <aggressively releasing JDBC connection>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.jdbc.ConnectionManager] - <releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - <returning connection to pool, pool size: 1>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.impl.SessionImpl] - <after transaction completion>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.impl.SessionImpl] - <closing session>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.jdbc.ConnectionManager] - <connection already null in cleanup : no action>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.impl.SessionImpl] - <opened session at timestamp: 4803301302923264>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.transaction.JDBCTransaction] - <begin>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.jdbc.ConnectionManager] - <opening JDBC connection>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - <total checked-out connections: 0>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - <using pooled JDBC connection, pool size: 0>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.transaction.JDBCTransaction] - <current autocommit status: false>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.jdbc.JDBCContext] - <after transaction begin>
2007-02-28 17:43:02,159 DEBUG [org.hibernate.engine.query.QueryPlanCache] - <unable to locate HQL query plan in cache; generating (from org.akaloo.common.tools.persistence.component.recurse.A)>
2007-02-28 17:43:02,269 DEBUG [org.hibernate.hql.ast.QueryTranslatorImpl] - <parse() - HQL: from org.akaloo.common.tools.persistence.component.recurse.A>
2007-02-28 17:43:02,285 DEBUG [org.hibernate.hql.ast.AST] - <--- HQL AST ---
\-[QUERY] 'query'
\-[SELECT_FROM] 'SELECT_FROM'
\-[FROM] 'from'
\-[RANGE] 'RANGE'
\-[DOT] '.'
+-[DOT] '.'
| +-[DOT] '.'
| | +-[DOT] '.'
| | | +-[DOT] '.'
| | | | +-[DOT] '.'
| | | | | +-[DOT] '.'
| | | | | | +-[IDENT] 'org'
| | | | | | \-[IDENT] 'akaloo'
| | | | | \-[IDENT] 'common'
| | | | \-[IDENT] 'tools'
| | | \-[IDENT] 'persistence'
| | \-[IDENT] 'component'
| \-[IDENT] 'recurse'
\-[IDENT] 'A'
>
2007-02-28 17:43:02,285 DEBUG [org.hibernate.hql.ast.ErrorCounter] - <throwQueryException() : no errors>
2007-02-28 17:43:02,332 DEBUG [org.hibernate.hql.antlr.HqlSqlBaseWalker] - <select << begin [level=1, statement=select]>
2007-02-28 17:43:02,347 DEBUG [org.hibernate.hql.ast.tree.FromElement] - <FromClause{level=1} : org.akaloo.common.tools.persistence.component.recurse.A (no alias) -> a0_>
2007-02-28 17:43:02,347 DEBUG [org.hibernate.hql.antlr.HqlSqlBaseWalker] - <select : finishing up [level=1, statement=select]>
2007-02-28 17:43:02,347 DEBUG [org.hibernate.hql.ast.HqlSqlWalker] - <processQuery() : ( SELECT ( FromClause{level=1} TEST_A a0_ ) )>
2007-02-28 17:43:02,363 DEBUG [org.hibernate.hql.ast.HqlSqlWalker] - <Derived SELECT clause created.>
2007-02-28 17:43:02,379 DEBUG [org.hibernate.hql.ast.util.JoinProcessor] - <Using FROM fragment [TEST_A a0_]>
2007-02-28 17:43:02,379 DEBUG [org.hibernate.hql.antlr.HqlSqlBaseWalker] - <select >> end [level=1, statement=select]>
2007-02-28 17:43:02,379 DEBUG [org.hibernate.hql.ast.AST] - <--- SQL AST ---
\-[SELECT] QueryNode: 'SELECT' querySpaces (TEST_A)
+-[SELECT_CLAUSE] SelectClause: '{derived select clause}'
| +-[SELECT_EXPR] SelectExpressionImpl: 'a0_.UID as UID0_' {FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName=TEST_A,tableAlias=a0_,origin=null,colums={,className=org.akaloo.common.tools.persistence.component.recurse.A}}}
| \-[SQL_TOKEN] SqlFragment: 'a0_.NO_VERSION as NO2_0_, a0_.VAL as VAL0_, a0_.VAL_B as VAL4_0_, a0_.VAL_C as VAL5_0_, a0_.VAL_D as VAL6_0_'
\-[FROM] FromClause: 'from' FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[], fromElementByTableAlias=[a0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]}
\-[FROM_FRAGMENT] FromElement: 'TEST_A a0_' FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName=TEST_A,tableAlias=a0_,origin=null,colums={,className=org.akaloo.common.tools.persistence.component.recurse.A}}
>
2007-02-28 17:43:02,379 DEBUG [org.hibernate.hql.ast.ErrorCounter] - <throwQueryException() : no errors>
2007-02-28 17:43:02,379 DEBUG [org.hibernate.hql.ast.QueryTranslatorImpl] - <HQL: from org.akaloo.common.tools.persistence.component.recurse.A>
2007-02-28 17:43:02,379 DEBUG [org.hibernate.hql.ast.QueryTranslatorImpl] - <SQL: select a0_.UID as UID0_, a0_.NO_VERSION as NO2_0_, a0_.VAL as VAL0_, a0_.VAL_B as VAL4_0_, a0_.VAL_C as VAL5_0_, a0_.VAL_D as VAL6_0_ from TEST_A a0_>
2007-02-28 17:43:02,379 DEBUG [org.hibernate.hql.ast.ErrorCounter] - <throwQueryException() : no errors>
2007-02-28 17:43:02,410 DEBUG [org.hibernate.engine.query.HQLQueryPlan] - <HQL param location recognition took 16 mills (from org.akaloo.common.tools.persistence.component.recurse.A)>
2007-02-28 17:43:02,410 DEBUG [org.hibernate.engine.query.QueryPlanCache] - <located HQL query plan in cache (from org.akaloo.common.tools.persistence.component.recurse.A)>
2007-02-28 17:43:02,410 DEBUG [org.hibernate.engine.query.HQLQueryPlan] - <find: from org.akaloo.common.tools.persistence.component.recurse.A>
2007-02-28 17:43:02,410 DEBUG [org.hibernate.engine.QueryParameters] - <named parameters: {}>
2007-02-28 17:43:02,410 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <about to open PreparedStatement (open PreparedStatements: 0, globally: 0)>
2007-02-28 17:43:02,410 DEBUG [org.hibernate.SQL] - <select a0_.UID as UID0_, a0_.NO_VERSION as NO2_0_, a0_.VAL as VAL0_, a0_.VAL_B as VAL4_0_, a0_.VAL_C as VAL5_0_, a0_.VAL_D as VAL6_0_ from TEST_A a0_>
Hibernate: select a0_.UID as UID0_, a0_.NO_VERSION as NO2_0_, a0_.VAL as VAL0_, a0_.VAL_B as VAL4_0_, a0_.VAL_C as VAL5_0_, a0_.VAL_D as VAL6_0_ from TEST_A a0_
2007-02-28 17:43:02,410 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <preparing statement>
2007-02-28 17:43:02,426 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <about to open ResultSet (open ResultSets: 0, globally: 0)>
2007-02-28 17:43:02,426 DEBUG [org.hibernate.loader.Loader] - <processing result set>
2007-02-28 17:43:02,426 DEBUG [org.hibernate.loader.Loader] - <result set row: 0>
2007-02-28 17:43:02,426 DEBUG [org.hibernate.type.LongType] - <returning '1' as column: UID0_>
2007-02-28 17:43:02,426 DEBUG [org.hibernate.loader.Loader] - <result row: EntityKey[org.akaloo.common.tools.persistence.component.recurse.A#1]>
2007-02-28 17:43:02,426 DEBUG [org.hibernate.loader.Loader] - <Initializing object from ResultSet: [org.akaloo.common.tools.persistence.component.recurse.A#1]>
2007-02-28 17:43:02,426 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - <Hydrating entity: [org.akaloo.common.tools.persistence.component.recurse.A#1]>
2007-02-28 17:43:02,426 DEBUG [org.hibernate.type.IntegerType] - <returning '0' as column: NO2_0_>
2007-02-28 17:43:02,426 DEBUG [org.hibernate.type.IntegerType] - <returning '0' as column: VAL0_>
2007-02-28 17:43:02,426 DEBUG [org.hibernate.type.IntegerType] - <returning '0' as column: VAL4_0_>
2007-02-28 17:43:02,426 DEBUG [org.hibernate.type.IntegerType] - <returning '0' as column: VAL5_0_>
2007-02-28 17:43:02,426 DEBUG [org.hibernate.type.IntegerType] - <returning '0' as column: VAL6_0_>
2007-02-28 17:43:02,426 DEBUG [org.hibernate.engine.TwoPhaseLoad] - <Version: 0>
2007-02-28 17:43:02,426 DEBUG [org.hibernate.loader.Loader] - <done processing result set (1 rows)>
2007-02-28 17:43:02,426 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <about to close ResultSet (open ResultSets: 1, globally: 1)>
2007-02-28 17:43:02,426 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <about to close PreparedStatement (open PreparedStatements: 1, globally: 1)>
2007-02-28 17:43:02,426 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <closing statement>
2007-02-28 17:43:02,426 DEBUG [org.hibernate.loader.Loader] - <total objects hydrated: 1>
2007-02-28 17:43:02,426 DEBUG [org.hibernate.engine.TwoPhaseLoad] - <resolving associations for [org.akaloo.common.tools.persistence.component.recurse.A#1]>
2007-02-28 17:43:02,426 ERROR [org.hibernate.property.BasicPropertyAccessor] - <IllegalArgumentException in class: org.akaloo.common.tools.persistence.component.recurse.D, setter method of property: c>
2007-02-28 17:43:02,426 ERROR [org.hibernate.property.BasicPropertyAccessor] - <expected type: org.akaloo.common.tools.persistence.component.recurse.C, actual value: org.akaloo.common.tools.persistence.component.recurse.A>
---------------------------------------------------------------
I have tested several scenarios similar to the above
I have a main class (A) with 3 components recusively included as follows:
A
|-B
|-C
|-D
In the case above, D has a <parent> property to C.
While loading an instance of A, it seems that D.setC(...) is called with the value of the main class A.
I don't know if this is a bug, or if parent is not recusively supported.
Any help is appreciated.
Thks, K.
NB: I have tried many different examples (with list and composite-element, etc.) and they all fail with 2+ levels of recursion.
Code: