Emmanuel, thanks!
But it REALLY doesn't work.
Here is full bebug output. Could you please take a look?
testing: class com.usaa.bank.clo.bom.product.definition.Collateral
09:30:17,210 INFO Environment:462 - Hibernate 2.1.2
09:30:17,226 INFO Environment:496 - loaded properties from resource hibernate.properties: {hibernate.cglib.use_reflection_optimizer=false, hibernate.dialect=net.sf.hibernate.dialect.DB2Dialect}
09:30:17,226 INFO Environment:530 - JVM does not support Statement.getGeneratedKeys()
09:30:17,241 INFO Environment:541 - JVM does not support LinkedHasMap, LinkedHashSet - ordered maps and sets disabled
09:30:17,241 INFO Environment:544 - using workaround for JVM bug in java.sql.Timestamp
09:30:17,241 INFO Configuration:311 - Mapping resource: com/usaa/bank/clo/bom/product/definition/Collateral.hbm.xml
09:30:17,351 DEBUG DTDEntityResolver:20 - trying to locate
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath under net/sf/hibernate/
09:30:17,366 DEBUG DTDEntityResolver:29 - found
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath
09:30:17,679 INFO Binder:229 - Mapping class: com.usaa.bank.clo.bom.product.definition.Collateral -> collateral
09:30:17,788 DEBUG Binder:462 - Mapped property: id -> id, type: long
09:30:17,835 DEBUG Binder:462 - Mapped property: text -> text, type: string
09:30:17,851 INFO Configuration:595 - processing one-to-many association mappings
09:30:17,851 INFO Configuration:604 - processing one-to-one association property references
09:30:17,866 INFO Configuration:629 - processing foreign key constraints
09:30:17,898 INFO Dialect:82 - Using dialect: net.sf.hibernate.dialect.DB2Dialect
09:30:17,913 INFO SettingsFactory:62 - Use outer join fetching: true
09:30:18,257 INFO SettingsFactory:102 - Use scrollable result sets: true
09:30:18,257 INFO SettingsFactory:105 - Use JDBC3 getGeneratedKeys(): false
09:30:18,273 INFO SettingsFactory:108 - Optimize cache for minimal puts: false
09:30:18,288 INFO SettingsFactory:117 - Query language substitutions: {}
09:30:18,288 INFO SettingsFactory:128 - cache provider: net.sf.ehcache.hibernate.Provider
09:30:18,304 INFO Configuration:1080 - instantiating and configuring caches
09:30:18,476 INFO SessionFactoryImpl:119 - building session factory
09:30:18,491 DEBUG SessionFactoryImpl:125 - instantiating session factory with properties: {java.assistive=ON, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, sun.boot.library.path=C:\Program Files\IBM\WebSphere Studio\eclipse\jre\bin, java.vm.version=1.3.1, java.vm.vendor=IBM Corporation, java.vendor.url=http://www.ibm.com/, path.separator=;, java.vm.name=Classic VM, file.encoding.pkg=sun.io, use_outer_join=true, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\codebase\BK_CLO\workspace\BankCLOBusinessObjectModelTest, java.runtime.version=1.3.1, java.fullversion=J2RE 1.3.1 IBM Windows 32 build cn131-20020710 (JIT enabled: jitc), java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\dk65861\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\eclipse\jre\bin;.;C:\WINDOWS\System32;C:\WINDOWS;C:\orant\bin;C:\Perl\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\IBM\Personal Communications\;C:\Program Files\IBM\Trace Facility\;c:\Program Files\Starbase\StarGate SDK\Lib;C:\WINDOWS\System32\;C:\WINDOWS\;C:\Program Files\Rational\common;C:\Program Files\Rational\Rose\TopLink\;C:\Program Files\Oracle\jre\1.1.8\bin;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Ant\Bin;C:\SQLlib\BIN;C:\SQLlib\FUNCTION;C:\SQLlib\SAMPLES\REPL;C:\SQLlib\HELP;C:\IBM\IMNNQ, java.specification.name=Java Platform API Specification, java.class.version=46.0, invokedviajava=, os.version=5.1, user.home=C:\Documents and Settings\dk65861, user.timezone=America/Chicago, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.3, show_sql=true, user.name=dk65861, java.class.path=C:/Program Files/IBM/WebSphere Studio/eclipse/plugins/org.eclipse.jdt.junit_2.0.1/junitsupport.jar;C:\codebase\BK_CLO\workspace\BankCLOBusinessObjectModelTest\build;C:\codebase\BK_CLO\workspace\BankCLOBusinessObjectModel\build\classes;C:\codebase\BK_CLO\workspace\BankCLOCommon\build;C:\www\inf\third_party\junit3.8.1\junit.jar;C:\www\inf\third_party\common\lib\eablib.jar;C:\www\inf\third_party\common\lib\ccf.jar;C:\www\inf\third_party\common\lib\connector.jar;C:\www\inf\third_party\common\lib\imsconn.jar;C:\www\inf\third_party\common\lib\recjava.jar;C:\www\inf\usaa\inf_appcomp\lib\inf_devcomp.jar;C:\www\inf\usaa\inf_apputils\lib\inf_devutil.jar;C:\www\inf\usaa\inf_core\lib\inf_core.jar;C:\www\inf\usaa\inf_utils\lib\inf_utils.jar;C:\www\inf\usaa\inf_conn\lib\inf_conn.jar;C:\www\inf\usaa\inf_commsvcs\lib\inf_commsvcs.jar;C:\www\enterprise\usaa\corp\cp_conn\lib\cp_conn.jar;C:\Program Files\IBM\WebSphere Studio\runtimes\ee_v5\lib\asynchbeans.jar;C:\Program Files\IBM\WebSphere Studio\runtimes\ee_v5\lib\wsexception.jar;C:\www\inf\usaa\ewf\lib\WorkflowMgr_vers4.jar;C:\www\inf\usaa\ewf\lib\BusinessSvc_vers4.jar;C:\www\inf\usaa\ewf\lib\DocumentServices_vers1.jar;C:\www\inf\third_party\hibernate-2.1\lib\commons-logging.jar;C:\codebase\BK_CLO\workspace\EnterpriseForCLO\build;C:\www\inf\usaa\inf_bs\lib\inf_bs.jar;C:\Program Files\IBM\WebSphere Studio\runtimes\ee_v5\lib\acwa.jar;C:\www\inf\usaa\inf_hdc\lib\inf_hdc.jar;C:\Program Files\IBM\WebSphere Studio\runtimes\base_v5\java\jre\lib\rt.jar;C:\codebase\BK_CLO\workspace\BankCLOConnectivityServicesEJB\build;C:\www\inf\usaa\inf_commsvcs\config;C:\www\inf\usaa\inf_dataaccess\config;C:\www\enterprise\usaa\corp\cp_conn\lib\cp_conn.jar;C:\www\inf\usaa\inf_conn\lib\inf_conn.jar;C:\www\inf\usaa\inf_dataaccess\lib\inf_dataaccess.jar;C:\www\inf\usaa\inf_utils\lib\inf_utils.jar;C:\www\inf\third_party\common\lib\eablib.jar;C:\www\inf\usaa\inf_hdc\lib\inf_hdc.jar;C:\www\inf\third_party\common\lib\recjava.jar;C:\www\inf\usaa\inf_commsvcs\lib\inf_commsvcs.jar;C:\www\inf\third_party\common\lib\concurrent.jar;C:\www\inf\third_party\common\lib\imsconn.jar;C:\www\inf\third_party\common\lib\betwixt.jar;C:\www\inf\third_party\common\lib\ccf.jar;C:\www\inf\third_party\common\lib\connector.jar;C:\www\inf\usaa\inf_utils\lib\inf_jaxb_util.jar;C:\www\inf\usaa\inf_utils\lib\fdrEJB.jar;C:\www\inf\third_party\common\lib\namespace.jar;C:\www\inf\third_party\common\lib\relaxngDatatype.jar;C:\www\inf\third_party\common\lib\xsdlib.jar;C:\www\inf\third_party\common\lib\jaxb-api.jar;C:\www\inf\third_party\common\lib\jaxb-impl.jar;C:\www\inf\third_party\common\lib\jaxb-libs.jar;C:\www\inf\third_party\common\lib\jaxb-xjc.jar;C:\www\inf\usaa\inf_bs\lib\inf_bs.jar;C:\www\inf\third_party\common\lib\jdom.jar;C:\Program Files\IBM\WebSphere Studio\runtimes\ee_v5\lib\j2ee.jar;C:\Program Files\IBM\WebSphere Studio\runtimes\ee_v5\lib\ivjejb35.jar;C:\Program Files\IBM\WebSphere Studio\runtimes\ee_v5\lib\vaprt.jar;C:\Program Files\IBM\WebSphere Studio\runtimes\ee_v5\lib\ras.jar;C:\Program Files\IBM\WebSphere Studio\runtimes\ee_v5\lib\utils.jar;C:\Program Files\IBM\WebSphere Studio\runtimes\ee_v5\lib\runtime.jar;C:\Program Files\IBM\WebSphere Studio\runtimes\ee_v5\lib\rsaexternal.jar;C:\Program Files\IBM\WebSphere Studio\runtimes\ee_v5\lib\ecutils.jar;C:\Program Files\IBM\WebSphere Studio\runtimes\ee_v5\lib\ejbportable.jar;C:\Program Files\IBM\WebSphere Studio\runtimes\ee_v5\lib\runtimefw.jar;C:\Program Files\IBM\WebSphere Studio\runtimes\ee_v5\lib\pmimpl.jar;C:\Program Files\IBM\WebSphere Studio\runtimes\ee_v5\lib\pm.jar;C:\Program Files\IBM\WebSphere Studio\runtimes\ee_v5\lib\appprofile.jar;C:\Program Files\IBM\WebSphere Studio\runtimes\ee_v5\lib\rsadaptercci.jar;C:\Program Files\IBM\WebSphere Studio\runtimes\ee_v5\lib\rsadapterspi.jar;C:\Program Files\IBM\WebSphere Studio\runtimes\ee_v5\lib\querymd.jar;C:\www\inf\usaa\inf_emp\lib\emp_ssn.jar;C:\Program Files\IBM\WebSphere Studio\runtimes\ee_v5\lib\ejbcontainer.jar;C:\www\inf\third_party\hibernate-2.1\lib\commons-lang.jar;C:\www\inf\third_party\hibernate-2.1\hibernate2.jar;C:\www\inf\usaa\inf_dataaccess\lib\inf_dataaccess.jar;C:\www\inf\third_party\common\lib\commons-discovery.jar;C:\codebase\BK_CLO\workspace\BankCLOPersistenceManagement\build;C:\www\inf\third_party\Spring-M-4\spring.jar;C:\www\inf\third_party\aop-alliance\aopalliance.jar;C:\www\inf\third_party\hibernate-2.1\hibernate2.jar;C:\www\inf\third_party\hibernate-2.1\lib\ant.jar;C:\www\inf\third_party\hibernate-2.1\lib\c3p0.jar;C:\www\inf\third_party\hibernate-2.1\lib\cglib2.jar;C:\www\inf\third_party\hibernate-2.1\lib\commons-beanutils.jar;C:\www\inf\third_party\hibernate-2.1\lib\commons-collections.jar;C:\www\inf\third_party\hibernate-2.1\lib\commons-dbcp.jar;C:\www\inf\third_party\hibernate-2.1\lib\commons-lang.jar;C:\www\inf\third_party\hibernate-2.1\lib\commons-logging.jar;C:\www\inf\third_party\hibernate-2.1\lib\commons-pool.jar;C:\www\inf\third_party\hibernate-2.1\lib\concurrent.jar;C:\www\inf\third_party\hibernate-2.1\lib\connector.jar;C:\www\inf\third_party\hibernate-2.1\lib\dom4j.jar;C:\www\inf\third_party\hibernate-2.1\lib\ehcache.jar;C:\www\inf\third_party\hibernate-2.1\lib\hibernate-tools.jar;C:\www\inf\third_party\hibernate-2.1\lib\jaas.jar;C:\www\inf\third_party\hibernate-2.1\lib\jcs.jar;C:\www\inf\third_party\hibernate-2.1\lib\jdbc2_0-stdext.jar;C:\www\inf\third_party\hibernate-2.1\lib\jgroups.jar;C:\www\inf\third_party\hibernate-2.1\lib\jta.jar;C:\www\inf\third_party\hibernate-2.1\lib\junit.jar;C:\www\inf\third_party\hibernate-2.1\lib\log4j-1.2.8.jar;C:\www\inf\third_party\hibernate-2.1\lib\odmg.jar;C:\www\inf\third_party\hibernate-2.1\lib\optional.jar;C:\www\inf\third_party\hibernate-2.1\lib\oscache.jar;C:\www\inf\third_party\hibernate-2.1\lib\proxool.jar;C:\www\inf\third_party\hibernate-2.1\lib\swarmcache.jar;C:\www\inf\third_party\hibernate-2.1\lib\xalan.jar;C:\www\inf\third_party\hibernate-2.1\lib\xerces.jar;C:\www\inf\third_party\hibernate-2.1\lib\xml-apis.jar;C:\SQLlib\java12\db2java.zip, java.vm.specification.version=1.0, java.home=C:\Program Files\IBM\WebSphere Studio\eclipse\jre, hibernate.dialect=net.sf.hibernate.dialect.DB2Dialect, 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-20020710 (JIT enabled: jitc), java.version=1.3.1, java.ext.dirs=C:\Program Files\IBM\WebSphere Studio\eclipse\jre\lib\ext, sun.boot.class.path=C:\Program Files\IBM\WebSphere Studio\eclipse\jre\lib\rt.jar, java.vendor=IBM Corporation, file.separator=\, hibernate.connection.provider_class=org.springframework.orm.hibernate.LocalDataSourceConnectionProvider, java.vendor.url.bug=, java.compiler=jitc, sun.io.unicode.encoding=UnicodeLittle, user.region=US}
09:30:19,366 DEBUG SessionFactoryObjectFactory:39 - initializing class SessionFactoryObjectFactory
09:30:19,398 DEBUG SessionFactoryObjectFactory:76 - registered: 8a86a72afb167f1400fb167f18660000 (unnamed)
09:30:19,413 INFO SessionFactoryObjectFactory:82 - no JNDI name configured
09:30:19,444 DEBUG SessionFactoryImpl:196 - instantiated session factory
09:30:20,132 DEBUG SessionImpl:531 - opened session
09:30:20,163 DEBUG JDBCTransaction:37 - begin
09:30:20,179 DEBUG JDBCTransaction:41 - current autocommit status:true
09:30:20,194 DEBUG JDBCTransaction:43 - disabling autocommit
Init before persistence time: 5313
09:30:20,226 DEBUG Cascades:341 - id unsaved-value strategy NULL
09:30:20,241 DEBUG SessionImpl:1950 - loading [com.usaa.bank.clo.bom.product.definition.Collateral#5]
09:30:20,273 DEBUG SessionImpl:2047 - attempting to resolve [com.usaa.bank.clo.bom.product.definition.Collateral#5]
09:30:20,288 DEBUG SessionImpl:2080 - object not resolved in any cache [com.usaa.bank.clo.bom.product.definition.Collateral#5]
09:30:20,319 DEBUG EntityPersister:416 - Materializing entity: [com.usaa.bank.clo.bom.product.definition.Collateral#5]
09:30:20,351 DEBUG BatcherImpl:196 - about to open: 0 open PreparedStatements, 0 open ResultSets
09:30:20,366 DEBUG SQL:237 - select collateral0_.id as id0_, collateral0_.text as text0_ from collateral collateral0_ where collateral0_.id=?
09:30:20,398 DEBUG BatcherImpl:241 - preparing statement
09:30:20,444 DEBUG LongType:46 - binding '5' to parameter: 1
09:30:20,491 DEBUG Loader:197 - processing result set
09:30:20,523 DEBUG Loader:226 - done processing result set (0 rows)
09:30:20,554 DEBUG BatcherImpl:203 - done closing: 0 open PreparedStatements, 0 open ResultSets
09:30:20,585 DEBUG BatcherImpl:261 - closing statement
09:30:20,616 DEBUG Loader:239 - total objects hydrated: 0
09:30:20,648 DEBUG SessionImpl:3082 - initializing non-lazy collections
09:30:20,679 DEBUG SessionImpl:760 - generated identifier: 5
09:30:20,694 DEBUG SessionImpl:807 - saving [com.usaa.bank.clo.bom.product.definition.Collateral#5]
java.lang.NullPointerException
at java.lang.reflect.Method.invoke(Native Method)
at net.sf.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:96)
at net.sf.hibernate.persister.AbstractEntityPersister.getPropertyValues(AbstractEntityPersister.java:246)
at net.sf.hibernate.impl.SessionImpl.doCopy(SessionImpl.java:3990)
at net.sf.hibernate.impl.SessionImpl.saveOrUpdateCopy(SessionImpl.java:3938)
at com.usaa.bank.clo.persistence.impl.hibernate.HibernateSession.persistCopy(HibernateSession.java:369)
at com.usaa.bank.clo.persistence.mgmt.PersistenceManager.persistCopy(PersistenceManager.java:105)
at com.usaa.bank.clo.persistence.mgmt.PersistenceTest.testPersistence(PersistenceTest.java:114)
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 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:329)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:218)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:151)
09:30:20,741 DEBUG JDBCTransaction:82 - rollback
09:30:20,773 DEBUG SessionImpl:561 - transaction completion
09:30:20,788 DEBUG JDBCTransaction:103 - re-enabling autocommit
09:30:20,804 DEBUG SessionImpl:549 - closing session
09:30:20,819 DEBUG SessionImpl:3294 - disconnecting session
09:30:20,851 DEBUG SessionImpl:561 - transaction completion
close after persistence failure time: 125