Hello,
I'm facing a problem when I use a many-to-one relation.
I've looked at the reference manual (the Cat example) and searched the forum but I don't seem to find a post with the same error/behaviour as I have. So I was hoping you guys could help me out.
The problem occurs when I add a many-to-one relation to my mapping file (see below). If I try to query or load objects which I have not created in the currently active session then the many-to-one component causes an exception to be thrown (see stack trace below). If I query objects which I created in the same session all is going well. However I would like to be able to load some existing data from the database.
I created a minimum JUnit test which can (hopefully) reproduce the problem. If you run the test as it is posted you don't have any problems because the objects are created in the session in the SetUp method and are removed from it in the teardown method. So you can easily run the test multiple times without having an exception.
To reproduce my problem you have to:
- Comment out the delete section of the teardown function and run the test once more. No problem at the this stage. (The objects are succesfully inserted into the DB and not deleted).
- Comment out the create section in the setup function (if we don't do this we will off course have duplicate key exceptions). Now you should see the Error stack mentioned below.
I really hope you can help me with this.
Thanks in advance,
Kind Regards,
Niels Soeffers
Hibernate version: 3rc1
Mapping documents: test.hbm.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="A" table="A">
<composite-id name="compositePK" class="CompPK">
<key-property name="compositePart1" column="compositePart1" />
<key-property name="compositePart2" column="compositePart2" />
</composite-id>
<discriminator column="discriminator" type="string"/>
<property name="name" />
<join table="B">
<key>
<column name="compositePart1" />
<column name="compositePart2" />
</key>
<many-to-one name="associatedA" property-ref="name" column="referenceName" fetch="select" />
</join>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Code:
public class MappingTest extends TestCase {
private SessionFactory sessionFactory;
private Session session;
private HashSet objects = new HashSet();
protected void setUp() throws Exception {
super.setUp();
Configuration cfg = new Configuration();
cfg.configure();
sessionFactory = cfg.buildSessionFactory();
session = sessionFactory.openSession();
/*¨Create Objects with hibernate */
A a = new A();
CompPK pk = new CompPK();
pk.setCompositePart1(new Long(1));
pk.setCompositePart2(new Integer(0));
a.setCompositePK(pk);
a.setName("Test A");
session.save(a);
session.flush();
A child = new A();
pk = new CompPK();
pk.setCompositePart1(new Long(2));
pk.setCompositePart2(new Integer(0));
child.setCompositePK(pk);
child.setName("A's Name");
child.setAssociatedA(a);
session.save(child);
objects.add(a);
objects.add(child);
session.flush();
}
protected void tearDown() throws Exception {
super.tearDown();
/* Delete objects created by Hibernate library in SetUp */
/* If we skip this section and run the test.
* Afterwards we run another test where we comment out the section of the SetUp method where the objects are created.
* Now all further tests will fail. Because the objects are not initially created by hibernate.
*/
Iterator it = objects.iterator();
while ( it.hasNext()){
session.delete(it.next());
}
session.flush();
/* End of delete section */
session.close();
sessionFactory.close();
}
/* This Test works because we have */
public void testObjectsInsertedWithHibernate(){
Query q = session.createQuery("from A as a where a.compositePK.compositePart1 = 2 and a.compositePK.compositePart2 = 0");
A a = (A) q.uniqueResult();
assertNotNull(a);
assertEquals(a.getName(), "A's Name");
assertEquals(a.getAssociatedA().getName(), "Test A");
}
}
Code:
public class A {
public CompPK compositePK;
public A associatedA;
public String name;
public String discriminator;
public CompPK getCompositePK() {
return compositePK;
}
public String getName() {
return name;
}
public void setCompositePK(CompPK compPK) {
compositePK = compPK;
}
public void setName(String string) {
name = string;
}
public String getDiscriminator() {
return discriminator;
}
public void setDiscriminator(String string) {
discriminator = string;
}
public A getAssociatedA() {
return associatedA;
}
public void setAssociatedA(A a) {
associatedA = a;
}
}
Full stack trace of any exception that occurs:
org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of CompPK.compositePart1
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:119)
at org.hibernate.tuple.AbstractComponentTuplizer.getPropertyValue(AbstractComponentTuplizer.java:61)
at org.hibernate.tuple.AbstractComponentTuplizer.getPropertyValues(AbstractComponentTuplizer.java:67)
at org.hibernate.tuple.PojoComponentTuplizer.getPropertyValues(PojoComponentTuplizer.java:50)
at org.hibernate.type.ComponentType.getPropertyValues(ComponentType.java:257)
at org.hibernate.type.ComponentType.getHashCode(ComponentType.java:158)
at org.hibernate.engine.EntityKey.getHashCode(EntityKey.java:68)
at org.hibernate.engine.EntityKey.<init>(EntityKey.java:41)
at org.hibernate.type.ManyToOneType.scheduleBatchLoad(ManyToOneType.java:85)
at org.hibernate.type.ManyToOneType.hydrate(ManyToOneType.java:66)
at org.hibernate.persister.entity.BasicEntityPersister.hydrate(BasicEntityPersister.java:1663)
at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:877)
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:833)
at org.hibernate.loader.Loader.getRow(Loader.java:746)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:290)
at org.hibernate.loader.Loader.doQuery(Loader.java:384)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:203)
at org.hibernate.loader.Loader.doList(Loader.java:1499)
at org.hibernate.loader.Loader.list(Loader.java:1482)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:365)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:268)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:782)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:569)
at MappingTest.testObjectsInsertedWithHibernate(MappingTest.java:61)
at java.lang.reflect.Method.invoke(Native Method)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:392)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:276)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:167)
Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
at java.lang.reflect.Method.invoke(Native Method)
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:105)
... 36 more
Name and version of the database you are using: Oracle 9.2.0.5
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
[INFO] Environment - Hibernate 3.0rc1
[INFO] Environment - loaded properties from resource hibernate.properties: {hibernate.cglib.use_reflection_optimizer=false}
[INFO] Environment - JVM does not support Statement.getGeneratedKeys()
[INFO] Environment - JVM does not support LinkedHasMap, LinkedHashSet - ordered maps and sets disabled
[INFO] Environment - using workaround for JVM bug in java.sql.Timestamp
[INFO] Environment - using pre JDK 1.4 java.sql.Timestamp handling
[INFO] Configuration - configuring from resource: /hibernate.cfg.xml
[INFO] Configuration - Configuration resource: /hibernate.cfg.xml
[DEBUG] DTDEntityResolver - trying to locate
http://hibernate.sourceforge.net/hibern ... on-3.0.dtd in classpath under org/hibernate/
[DEBUG] DTDEntityResolver - found
http://hibernate.sourceforge.net/hibern ... on-3.0.dtd in classpath
[DEBUG] Configuration - hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver
[DEBUG] Configuration - hibernate.connection.url=jdbc:oracle:thin:@localhost:1521:nsoport
[DEBUG] Configuration - hibernate.connection.username=smk
[DEBUG] Configuration - hibernate.connection.password=smk
[DEBUG] Configuration - hibernate.jdbc.use_get_generated_keys=false
[DEBUG] Configuration - show_sql=true
[DEBUG] Configuration - dialect=org.hibernate.dialect.Oracle9Dialect
[DEBUG] Configuration - null<-org.dom4j.tree.DefaultAttribute@634f7d53 [Attribute: name resource value "test.hbm.xml"]
[INFO] Configuration - Mapping resource: test.hbm.xml
[DEBUG] DTDEntityResolver - trying to locate
http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd in classpath under org/hibernate/
[DEBUG] DTDEntityResolver - found
http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd in classpath
[INFO] HbmBinder - Mapping class: A -> A
[DEBUG] HbmBinder - Mapped property: compositePart1 -> compositePart1
[DEBUG] HbmBinder - Mapped property: compositePart2 -> compositePart2
[DEBUG] HbmBinder - Mapped property: compositePK -> compositePart1, compositePart2
[DEBUG] HbmBinder - Mapped property: name -> name
[INFO] HbmBinder - Mapping class join: A -> B
[DEBUG] HbmBinder - Mapped property: associatedA -> referenceName
[INFO] Configuration - Configured SessionFactory: null
[DEBUG] Configuration - properties: {java.assistive=ON, hibernate.connection.password=smk, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, sun.boot.library.path=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre\bin, java.vm.version=1.3.1, hibernate.connection.username=smk, java.vm.vendor=IBM Corporation, java.vendor.url=http://www.ibm.com/, path.separator=;, java.vm.name=Classic VM, file.encoding.pkg=sun.io, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\IBM\workspace\HibernateMappingTest, java.runtime.version=1.3.1, hibernate.jdbc.use_get_generated_keys=false, java.fullversion=J2RE 1.3.1 IBM Windows 32 build cn131-20031021 (JIT enabled: jitc), java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\NIELS~1.SOE\LOCALS~1\Temp\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., java.awt.fonts=, os.name=Windows XP, java.library.path=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\GTK\2.0\bin;;C:\MSSQL\BINN;C:\Progra~1\MySQL\MySQLS~1.1\bin;C:\oracle\ora92\bin;C:\Adabas\bin;C:\Adabas\pgm;C:\j2sdk1.4.2_01\bin;C:\Program Files\vim\vim32;C:\eclipse\plugins\org.apache.ant_1.6.1\bin;c:\Progra~1\TortoiseCVS\;c:\Progra~1\Vim\vim63;C:\SilverStream37\bin;c:\cygwin\bin, java.specification.name=Java Platform API Specification, java.class.version=46.0, invokedviajava=, os.version=5.1, user.home=C:\Documents and Settings\niels.soeffers, user.timezone=, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.3, hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, show_sql=true, user.name=niels.soeffers, java.class.path=C:/Program Files/IBM/WebSphere Studio/Application Developer/v5.1.2/eclipse/plugins/org.eclipse.jdt.junit_2.1.1/junitsupport.jar;C:\IBM\workspace\HibernateMappingTest\bin;C:\IBM\workspace\HibernateMappingTest\lib\ant-1.6.2.jar;C:\IBM\workspace\HibernateMappingTest\lib\ant-antlr-1.6.2.jar;C:\IBM\workspace\HibernateMappingTest\lib\ant-junit-1.6.2.jar;C:\IBM\workspace\HibernateMappingTest\lib\ant-launcher-1.6.2.jar;C:\IBM\workspace\HibernateMappingTest\lib\antlr-2.7.4.jar;C:\IBM\workspace\HibernateMappingTest\lib\ant-swing-1.6.2.jar;C:\IBM\workspace\HibernateMappingTest\lib\c3p0-0.8.5.jar;C:\IBM\workspace\HibernateMappingTest\lib\cglib-full-2.0.2.jar;C:\IBM\workspace\HibernateMappingTest\lib\cleanimports.jar;C:\IBM\workspace\HibernateMappingTest\lib\commons-collections-2.1.1.jar;C:\IBM\workspace\HibernateMappingTest\lib\commons-logging-1.0.4.jar;C:\IBM\workspace\HibernateMappingTest\lib\concurrent-1.3.2.jar;C:\IBM\workspace\HibernateMappingTest\lib\connector.jar;C:\IBM\workspace\HibernateMappingTest\lib\dom4j-1.5.2.jar;C:\IBM\workspace\HibernateMappingTest\lib\ehcache-1.1.jar;C:\IBM\workspace\HibernateMappingTest\lib\jaas.jar;C:\IBM\workspace\HibernateMappingTest\lib\jacc-1_0-fr.jar;C:\IBM\workspace\HibernateMappingTest\lib\jaxen-1.1-beta-4.jar;C:\IBM\workspace\HibernateMappingTest\lib\jboss-cache.jar;C:\IBM\workspace\HibernateMappingTest\lib\jboss-common.jar;C:\IBM\workspace\HibernateMappingTest\lib\jboss-jmx.jar;C:\IBM\workspace\HibernateMappingTest\lib\jboss-remoting.jar;C:\IBM\workspace\HibernateMappingTest\lib\jboss-system.jar;C:\IBM\workspace\HibernateMappingTest\lib\jdbc2_0-stdext.jar;C:\IBM\workspace\HibernateMappingTest\lib\jgroups-2.2.7.jar;C:\IBM\workspace\HibernateMappingTest\lib\jta.jar;C:\IBM\workspace\HibernateMappingTest\lib\junit-3.8.1.jar;C:\IBM\workspace\HibernateMappingTest\lib\log4j-1.2.9.jar;C:\IBM\workspace\HibernateMappingTest\lib\oscache-2.1.jar;C:\IBM\workspace\HibernateMappingTest\lib\proxool-0.8.3.jar;C:\IBM\workspace\HibernateMappingTest\lib\swarmcache-1.0rc2.jar;C:\IBM\workspace\HibernateMappingTest\lib\versioncheck.jar;C:\IBM\workspace\HibernateMappingTest\lib\xerces-2.6.2.jar;C:\IBM\workspace\HibernateMappingTest\lib\xml-apis.jar;C:\oracle\ora92\jdbc\lib\classes12.zip;C:\IBM\workspace\HibernateMappingTest\lib\hibernate3.jar, hibernate.show_sql=true, java.vm.specification.version=1.0, java.home=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre, hibernate.dialect=org.hibernate.dialect.Oracle9Dialect, hibernate.connection.url=jdbc:oracle:thin:@localhost:1521:nsoport, user.language=en, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=sun.awt.windows.WToolkit, hibernate.cglib.use_reflection_optimizer=false, java.vm.info=J2RE 1.3.1 IBM Windows 32 build cn131-20031021 (JIT enabled: jitc), java.version=1.3.1, java.ext.dirs=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre\lib\ext, sun.boot.class.path=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre\lib\rt.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre\lib\i18n.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre\lib\ext\indicim.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre\lib\ext\JawBridge.jar, java.vendor=IBM Corporation, file.separator=\, java.vendor.url.bug=, java.compiler=jitc, sun.io.unicode.encoding=UnicodeLittle, user.region=US, dialect=org.hibernate.dialect.Oracle9Dialect}
[DEBUG] Configuration - Preparing to build session factory with filters : {}
[INFO] Configuration - processing extends queue
[INFO] Configuration - processing collection mappings
[INFO] Configuration - processing association property references
[INFO] Configuration - processing foreign key constraints
[DEBUG] Configuration - resolving reference to class: A
[INFO] Dialect - Using dialect: org.hibernate.dialect.Oracle9Dialect
[INFO] SettingsFactory - Default batch fetch size: 1
[INFO] SettingsFactory - Generate SQL with comments: disabled
[INFO] SettingsFactory - Order SQL updates by primary key: disabled
[INFO] SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
[INFO] ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
[INFO] SettingsFactory - Query language substitutions: {}
[INFO] DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
[INFO] DriverManagerConnectionProvider - Hibernate connection pool size: 20
[INFO] DriverManagerConnectionProvider - autocommit mode: false
[INFO] DriverManagerConnectionProvider - using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@localhost:1521:nsoport
[INFO] DriverManagerConnectionProvider - connection properties: {user=smk, password=smk}
[DEBUG] DriverManagerConnectionProvider - opening new JDBC connection
[DEBUG] DriverManagerConnectionProvider - created connection to: jdbc:oracle:thin:@localhost:1521:nsoport, Isolation Level: 2
[INFO] SettingsFactory - JDBC batch size: 15
[INFO] SettingsFactory - JDBC batch updates for versioned data: disabled
[INFO] SettingsFactory - Scrollable result sets: enabled
[DEBUG] SettingsFactory - Wrap result sets: disabled
[INFO] SettingsFactory - JDBC3 getGeneratedKeys(): disabled
[INFO] TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)
[INFO] TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
[INFO] SettingsFactory - Automatic flush during beforeCompletion(): disabled
[INFO] SettingsFactory - Automatic session close at end of transaction: disabled
[INFO] SettingsFactory - Cache provider: org.hibernate.cache.EhCacheProvider
[INFO] SettingsFactory - Second-level cache: enabled
[INFO] SettingsFactory - Optimize cache for minimal puts: disabled
[INFO] SettingsFactory - Structured second-level cache entries: enabled
[INFO] SettingsFactory - Query cache: disabled
[INFO] SettingsFactory - Echoing all SQL to stdout
[INFO] SettingsFactory - Statistics: disabled
[INFO] SettingsFactory - Deleted entity synthetic identifier rollback: disabled
[INFO] SettingsFactory - Default entity-mode: pojo
[INFO] SessionFactoryImpl - building session factory
[DEBUG] SessionFactoryImpl - Session factory constructed with filter configurations : {}
[DEBUG] SessionFactoryImpl - instantiating session factory with properties: {java.assistive=ON, hibernate.connection.password=smk, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, sun.boot.library.path=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre\bin, java.vm.version=1.3.1, hibernate.connection.username=smk, java.vm.vendor=IBM Corporation, java.vendor.url=http://www.ibm.com/, path.separator=;, java.vm.name=Classic VM, file.encoding.pkg=sun.io, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\IBM\workspace\HibernateMappingTest, java.runtime.version=1.3.1, hibernate.jdbc.use_get_generated_keys=false, java.fullversion=J2RE 1.3.1 IBM Windows 32 build cn131-20031021 (JIT enabled: jitc), java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\NIELS~1.SOE\LOCALS~1\Temp\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., java.awt.fonts=, os.name=Windows XP, java.library.path=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\GTK\2.0\bin;;C:\MSSQL\BINN;C:\Progra~1\MySQL\MySQLS~1.1\bin;C:\oracle\ora92\bin;C:\Adabas\bin;C:\Adabas\pgm;C:\j2sdk1.4.2_01\bin;C:\Program Files\vim\vim32;C:\eclipse\plugins\org.apache.ant_1.6.1\bin;c:\Progra~1\TortoiseCVS\;c:\Progra~1\Vim\vim63;C:\SilverStream37\bin;c:\cygwin\bin, java.specification.name=Java Platform API Specification, java.class.version=46.0, invokedviajava=, os.version=5.1, user.home=C:\Documents and Settings\niels.soeffers, user.timezone=, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.3, hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, show_sql=true, user.name=niels.soeffers, java.class.path=C:/Program Files/IBM/WebSphere Studio/Application Developer/v5.1.2/eclipse/plugins/org.eclipse.jdt.junit_2.1.1/junitsupport.jar;C:\IBM\workspace\HibernateMappingTest\bin;C:\IBM\workspace\HibernateMappingTest\lib\ant-1.6.2.jar;C:\IBM\workspace\HibernateMappingTest\lib\ant-antlr-1.6.2.jar;C:\IBM\workspace\HibernateMappingTest\lib\ant-junit-1.6.2.jar;C:\IBM\workspace\HibernateMappingTest\lib\ant-launcher-1.6.2.jar;C:\IBM\workspace\HibernateMappingTest\lib\antlr-2.7.4.jar;C:\IBM\workspace\HibernateMappingTest\lib\ant-swing-1.6.2.jar;C:\IBM\workspace\HibernateMappingTest\lib\c3p0-0.8.5.jar;C:\IBM\workspace\HibernateMappingTest\lib\cglib-full-2.0.2.jar;C:\IBM\workspace\HibernateMappingTest\lib\cleanimports.jar;C:\IBM\workspace\HibernateMappingTest\lib\commons-collections-2.1.1.jar;C:\IBM\workspace\HibernateMappingTest\lib\commons-logging-1.0.4.jar;C:\IBM\workspace\HibernateMappingTest\lib\concurrent-1.3.2.jar;C:\IBM\workspace\HibernateMappingTest\lib\connector.jar;C:\IBM\workspace\HibernateMappingTest\lib\dom4j-1.5.2.jar;C:\IBM\workspace\HibernateMappingTest\lib\ehcache-1.1.jar;C:\IBM\workspace\HibernateMappingTest\lib\jaas.jar;C:\IBM\workspace\HibernateMappingTest\lib\jacc-1_0-fr.jar;C:\IBM\workspace\HibernateMappingTest\lib\jaxen-1.1-beta-4.jar;C:\IBM\workspace\HibernateMappingTest\lib\jboss-cache.jar;C:\IBM\workspace\HibernateMappingTest\lib\jboss-common.jar;C:\IBM\workspace\HibernateMappingTest\lib\jboss-jmx.jar;C:\IBM\workspace\HibernateMappingTest\lib\jboss-remoting.jar;C:\IBM\workspace\HibernateMappingTest\lib\jboss-system.jar;C:\IBM\workspace\HibernateMappingTest\lib\jdbc2_0-stdext.jar;C:\IBM\workspace\HibernateMappingTest\lib\jgroups-2.2.7.jar;C:\IBM\workspace\HibernateMappingTest\lib\jta.jar;C:\IBM\workspace\HibernateMappingTest\lib\junit-3.8.1.jar;C:\IBM\workspace\HibernateMappingTest\lib\log4j-1.2.9.jar;C:\IBM\workspace\HibernateMappingTest\lib\oscache-2.1.jar;C:\IBM\workspace\HibernateMappingTest\lib\proxool-0.8.3.jar;C:\IBM\workspace\HibernateMappingTest\lib\swarmcache-1.0rc2.jar;C:\IBM\workspace\HibernateMappingTest\lib\versioncheck.jar;C:\IBM\workspace\HibernateMappingTest\lib\xerces-2.6.2.jar;C:\IBM\workspace\HibernateMappingTest\lib\xml-apis.jar;C:\oracle\ora92\jdbc\lib\classes12.zip;C:\IBM\workspace\HibernateMappingTest\lib\hibernate3.jar, hibernate.show_sql=true, java.vm.specification.version=1.0, java.home=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre, hibernate.dialect=org.hibernate.dialect.Oracle9Dialect, hibernate.connection.url=jdbc:oracle:thin:@localhost:1521:nsoport, user.language=en, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=sun.awt.windows.WToolkit, hibernate.cglib.use_reflection_optimizer=false, java.vm.info=J2RE 1.3.1 IBM Windows 32 build cn131-20031021 (JIT enabled: jitc), java.version=1.3.1, java.ext.dirs=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre\lib\ext, sun.boot.class.path=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre\lib\rt.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre\lib\i18n.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre\lib\ext\indicim.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre\lib\ext\JawBridge.jar, java.vendor=IBM Corporation, file.separator=\, java.vendor.url.bug=, java.compiler=jitc, sun.io.unicode.encoding=UnicodeLittle, user.region=US, dialect=org.hibernate.dialect.Oracle9Dialect}
[DEBUG] CacheManager - Creating new CacheManager with default config
[DEBUG] CacheManager - Configuring ehcache from classpath.
[WARN] Configurator - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/IBM/workspace/HibernateMappingTest/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
[DEBUG] Configuration$DiskStore - Disk Store Path: C:\DOCUME~1\NIELS~1.SOE\LOCALS~1\Temp\
[DEBUG] BasicEntityPersister - Static SQL for entity: A
[DEBUG] BasicEntityPersister - Version select: select compositePart1, compositePart2 from A where compositePart1 =? and compositePart2 =?
[DEBUG] BasicEntityPersister - Snapshot select: select a_.compositePart1, a_.compositePart2, a_.name as name0_, a_1_.referenceName as referenc3_1_ from A a_ inner join B a_1_ on a_.compositePart1=a_1_.compositePart1 and a_.compositePart2=a_1_.compositePart2 where a_.compositePart1=? and a_.compositePart2=?
[DEBUG] BasicEntityPersister - Insert 0: insert into A (name, discriminator, compositePart1, compositePart2) values (?, 'A', ?, ?)
[DEBUG] BasicEntityPersister - Update 0: update A set name=? where compositePart1=? and compositePart2=?
[DEBUG] BasicEntityPersister - Delete 0: delete from A where compositePart1=? and compositePart2=?
[DEBUG] BasicEntityPersister - Insert 1: insert into B (referenceName, compositePart1, compositePart2) values (?, ?, ?)
[DEBUG] BasicEntityPersister - Update 1: update B set referenceName=? where compositePart1=? and compositePart2=?
[DEBUG] BasicEntityPersister - Delete 1: delete from B where compositePart1=? and compositePart2=?
[DEBUG] EntityLoader - Static select for entity A: select a0_.compositePart1 as composit1_0_, a0_.compositePart2 as composit2_0_, a0_.name as name0_0_, a0_1_.referenceName as referenc3_1_0_ from A a0_ inner join B a0_1_ on a0_.compositePart1=a0_1_.compositePart1 and a0_.compositePart2=a0_1_.compositePart2 where a0_.compositePart1=? and a0_.compositePart2=?
[DEBUG] EntityLoader - Static select for entity A: select a0_.compositePart1 as composit1_0_, a0_.compositePart2 as composit2_0_, a0_.name as name0_0_, a0_1_.referenceName as referenc3_1_0_ from A a0_ inner join B a0_1_ on a0_.compositePart1=a0_1_.compositePart1 and a0_.compositePart2=a0_1_.compositePart2 where a0_.compositePart1=? and a0_.compositePart2=?
[DEBUG] EntityLoader - Static select for entity A: select a0_.compositePart1 as composit1_0_, a0_.compositePart2 as composit2_0_, a0_.name as name0_0_, a0_1_.referenceName as referenc3_1_0_ from A a0_ inner join B a0_1_ on a0_.compositePart1=a0_1_.compositePart1 and a0_.compositePart2=a0_1_.compositePart2 where a0_.compositePart1=? and a0_.compositePart2=? for update
[DEBUG] EntityLoader - Static select for entity A: select a0_.compositePart1 as composit1_0_, a0_.compositePart2 as composit2_0_, a0_.name as name0_0_, a0_1_.referenceName as referenc3_1_0_ from A a0_ inner join B a0_1_ on a0_.compositePart1=a0_1_.compositePart1 and a0_.compositePart2=a0_1_.compositePart2 where a0_.compositePart1=? and a0_.compositePart2=? for update nowait
[DEBUG] EntityLoader - Static select for entity A: select a0_.compositePart1 as composit1_0_, a0_.compositePart2 as composit2_0_, a0_.name as name0_0_, a0_1_.referenceName as referenc3_1_0_ from A a0_ inner join B a0_1_ on a0_.compositePart1=a0_1_.compositePart1 and a0_.compositePart2=a0_1_.compositePart2 where a0_.name=?
[DEBUG] SessionFactoryObjectFactory - initializing class SessionFactoryObjectFactory
[DEBUG] SessionFactoryObjectFactory - registered: ff808081028bc80501028bc806770000 (unnamed)
[INFO] SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
[DEBUG] SessionFactoryImpl - instantiated session factory
[INFO] SessionFactoryImpl - Checking 0 named queries
[DEBUG] SessionImpl - opened session
[DEBUG] QueryTranslatorImpl - parse() - HQL: from A as a where a.compositePK.compositePart1 = 2 and a.compositePK.compositePart2 = 0
[DEBUG] AST - --- HQL AST ---
\-[QUERY] CommonAST: 'query'
+-[SELECT_FROM] CommonAST: 'SELECT_FROM'
| \-[FROM] CommonAST: 'from'
| +-[IDENT] CommonAST: 'A'
| \-[ALIAS] CommonAST: 'a'
\-[WHERE] CommonAST: 'where'
\-[AND] CommonAST: 'and'
+-[EQ] CommonAST: '='
| +-[DOT] CommonAST: '.'
| | +-[DOT] CommonAST: '.'
| | | +-[IDENT] CommonAST: 'a'
| | | \-[IDENT] CommonAST: 'compositePK'
| | \-[IDENT] CommonAST: 'compositePart1'
| \-[NUM_INT] CommonAST: '2'
\-[EQ] CommonAST: '='
+-[DOT] CommonAST: '.'
| +-[DOT] CommonAST: '.'
| | +-[IDENT] CommonAST: 'a'
| | \-[IDENT] CommonAST: 'compositePK'
| \-[IDENT] CommonAST: 'compositePart2'
\-[NUM_INT] CommonAST: '0'
[DEBUG] parser - throwQueryException() : no errors
[DEBUG] HqlSqlBaseWalker - query() << begin, level = 1
[DEBUG] FromElement - A (a) -> a0_
[DEBUG] FromReferenceNode - Resolved : a -> {composite id for a}
[DEBUG] DotNode - getDataType() : compositePK -> org.hibernate.type.ComponentType@26dffd53
[DEBUG] DotNode - Unresolved property path is now 'compositePK.compositePart1'
[DEBUG] FromReferenceNode - Resolved : a.compositePK -> a0_.compositePart1
[DEBUG] DotNode - getDataType() : compositePK.compositePart1 -> org.hibernate.type.LongType@234fd50
[DEBUG] FromReferenceNode - Resolved : a.compositePK.compositePart1 -> a0_.compositePart1
[DEBUG] FromReferenceNode - Resolved : a -> {composite id for a}
[DEBUG] DotNode - getDataType() : compositePK -> org.hibernate.type.ComponentType@26dffd53
[DEBUG] DotNode - Unresolved property path is now 'compositePK.compositePart2'
[DEBUG] FromReferenceNode - Resolved : a.compositePK -> a0_.compositePart2
[DEBUG] DotNode - getDataType() : compositePK.compositePart2 -> org.hibernate.type.IntegerType@23afd50
[DEBUG] FromReferenceNode - Resolved : a.compositePK.compositePart2 -> a0_.compositePart2
[DEBUG] HqlSqlBaseWalker - query() : finishing up...
[DEBUG] HqlSqlWalker - Derived SELECT clause created.
[DEBUG] JoinProcessor - Using FROM fragment [A a0_ inner join B a0_1_ on a0_.compositePart1=a0_1_.compositePart1 and a0_.compositePart2=a0_1_.compositePart2]
[DEBUG] HqlSqlBaseWalker - query() >> end, level = 1
[DEBUG] AST - --- SQL AST ---
\-[SELECT] QueryNode: 'SELECT' querySpaces (A,B)
+-[SELECT_CLAUSE] SelectClause: '{derived select clause}'
| +-[SELECT_EXPR] SelectExpressionImpl: 'a0_.compositePart1 as composit1_, a0_.compositePart2 as composit2_' {FromElement{explicit,not a collection join,classAlias=a,role=null,tableName=A,tableAlias=a0_,colums={,className=A}}}
| \-[SQL_TOKEN] SqlFragment: 'a0_.name as name0_, a0_1_.referenceName as referenc3_1_'
+-[FROM] FromClause: 'from' FromClause{from}
| \-[FROM_FRAGMENT] FromElement: 'A a0_ inner join B a0_1_ on a0_.compositePart1=a0_1_.compositePart1 and a0_.compositePart2=a0_1_.compositePart2' FromElement{explicit,not a collection join,classAlias=a,role=null,tableName=A,tableAlias=a0_,colums={,className=A}}
\-[WHERE] SqlNode: 'where'
\-[AND] SqlNode: 'and'
+-[EQ] SqlNode: '='
| +-[DOT] DotNode: 'a0_.compositePart1' {propertyName=compositePart1,dereferenceType=4,propertyPath=compositePK.compositePart1,path=a.compositePK.compositePart1,tableAlias=a0_,className=A,classAlias=a}
| | +-[DOT] DotNode: 'a0_.compositePart1' {propertyName=compositePart1,dereferenceType=2,propertyPath=compositePK.compositePart1,path=a.compositePK,tableAlias=a0_,className=A,classAlias=a}
| | | +-[ALIAS_REF] IdentNode: '{composite id for a}' {alias=a, className=A, tableAlias=a0_}
| | | \-[IDENT] IdentNode: 'compositePK' {originalText=compositePK}
| | \-[IDENT] IdentNode: 'compositePart1' {originalText=compositePart1}
| \-[NUM_INT] LiteralNode: '2'
\-[EQ] SqlNode: '='
+-[DOT] DotNode: 'a0_.compositePart2' {propertyName=compositePart2,dereferenceType=4,propertyPath=compositePK.compositePart2,path=a.compositePK.compositePart2,tableAlias=a0_,className=A,classAlias=a}
| +-[DOT] DotNode: 'a0_.compositePart2' {propertyName=compositePart2,dereferenceType=2,propertyPath=compositePK.compositePart2,path=a.compositePK,tableAlias=a0_,className=A,classAlias=a}
| | +-[ALIAS_REF] IdentNode: '{composite id for a}' {alias=a, className=A, tableAlias=a0_}
| | \-[IDENT] IdentNode: 'compositePK' {originalText=compositePK}
| \-[IDENT] IdentNode: 'compositePart2' {originalText=compositePart2}
\-[NUM_INT] LiteralNode: '0'
[DEBUG] parser - throwQueryException() : no errors
[DEBUG] QueryTranslatorImpl - HQL: from A as a where a.compositePK.compositePart1 = 2 and a.compositePK.compositePart2 = 0
[DEBUG] QueryTranslatorImpl - SQL: select a0_.compositePart1 as composit1_, a0_.compositePart2 as composit2_, a0_.name as name0_, a0_1_.referenceName as referenc3_1_ from A a0_ inner join B a0_1_ on a0_.compositePart1=a0_1_.compositePart1 and a0_.compositePart2=a0_1_.compositePart2 where (a0_.compositePart1=2 and a0_.compositePart2=0)
[DEBUG] parser - throwQueryException() : no errors
[DEBUG] AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
[DEBUG] AbstractBatcher - opening JDBC connection
[DEBUG] SQL - select a0_.compositePart1 as composit1_, a0_.compositePart2 as composit2_, a0_.name as name0_, a0_1_.referenceName as referenc3_1_ from A a0_ inner join B a0_1_ on a0_.compositePart1=a0_1_.compositePart1 and a0_.compositePart2=a0_1_.compositePart2 where (a0_.compositePart1=2 and a0_.compositePart2=0)
Hibernate: select a0_.compositePart1 as composit1_, a0_.compositePart2 as composit2_, a0_.name as name0_, a0_1_.referenceName as referenc3_1_ from A a0_ inner join B a0_1_ on a0_.compositePart1=a0_1_.compositePart1 and a0_.compositePart2=a0_1_.compositePart2 where (a0_.compositePart1=2 and a0_.compositePart2=0)
[DEBUG] AbstractBatcher - about to open ResultSet (open ResultSets: 0, globally: 0)
[DEBUG] Loader - result row: EntityKey[A#component[compositePart1,compositePart2]{compositePart2=0, compositePart1=2}]
[ERROR] BasicPropertyAccessor - IllegalArgumentException in class: CompPK, getter method of property: compositePart1
[DEBUG] AbstractBatcher - about to close ResultSet (open ResultSets: 1, globally: 1)
[DEBUG] AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
[DEBUG] AbstractBatcher - closing JDBC connection (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)
[INFO] SessionFactoryImpl - closing
[INFO] DriverManagerConnectionProvider - cleaning up connection pool: jdbc:oracle:thin:@localhost:1521:nsoport