Thanks for your suggestion. All the objects that go into the "value" field are Serializable. They are mostly wrapper objects (Integer, Boolean, Double, etc...) and String.
Using type="serializable" I got to the point where I can create the containing objects in the database, and everything looks good there. The problem I am having now is I get an exception when I try to retrieve the containing objects from the database. Exception is below. AbstractValue is the containing object (note that its a concrete class now). "value" is the field which contains the entity that is being mapped as serializable.
Any help or suggestions will be appreciated. Thanks
Mapping documents:
<property name="Value"
column="VALUE"
type="serializable"
unique="false"
/>
org.hibernate.PropertyAccessException: Exception occurred inside setter of com.convera.adminApi.dataModel.values.AbstractValue.Value
at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:51)
at org.hibernate.tuple.AbstractTuplizer.setPropertyValues(AbstractTuplizer.java:207)
at org.hibernate.tuple.PojoTuplizer.setPropertyValues(PojoTuplizer.java:176)
at org.hibernate.persister.entity.BasicEntityPersister.setPropertyValues(BasicEntityPersister.java:2919)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:113)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:530)
at org.hibernate.loader.Loader.doQuery(Loader.java:436)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
at org.hibernate.loader.Loader.doList(Loader.java:1593)
at org.hibernate.loader.Loader.list(Loader.java:1577)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at com.convera.adminApi.dataModel.values.ValueFactory.getValueById(ValueFactory.java:229)
at com.convera.adminApi.dataModel.values.ValueFactory.deleteValue(ValueFactory.java:176)
at com.convera.adminApi.dataModel.values.ValueFactory.deleteValue(ValueFactory.java:156)
at com.convera.adminApi.dataModel.values.ValuesTest.testCreateStringValue(ValuesTest.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
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 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:40)
... 30 more
Caused by: java.lang.NullPointerException
at com.convera.adminApi.dataModel.values.AbstractValue.setValue(AbstractValue.java:80)
... 35 more
_________________ Doal Miller
Sr. Software Engineer
Convera
|