Joined: Tue Aug 30, 2005 7:04 pm Posts: 1 Location: Colorado
|
Hi, I'm fairly new to Hibernate and am using version 3.1
I've two tables that I'm trying to map using one object on the java side. The primary table STEP has an ID column that is the FK in STEP_PREV table. This second table only has one more column (called PREV_ID NOT NULL NUMBER) besides the ID column.
The mapping document looks like this...
<hibernate-mapping package="com.abc.vo">
<class name="StepVO" table="STEP">
<id name="id" column="ID" type="long">
<generator class="sequence">
<param name="sequence">hib_sequence</param>
</generator>
</id>
<property name="entryId" column="ENTRY_ID" type="long" />
<property name="stepId" column="STEP_ID" type="integer" />
<set name="prevIds" table="STEP_PREV" lazy="false" inverse="true" cascade="all-delete-orphan">
<key column="ID" not-null="true" />
<one-to-many class="StepVO" />
</set>
</class>
</hibernate-mapping>
org.springframework.orm.hibernate3.HibernateSystemException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.abc.vo.StepVO.setPrevIds; nested exception is org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.abc.vo.StepVO.setPrevIds
org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.abc.vo.StepVO.setPrevIds
at org.hibernate.tuple.PojoTuplizer.setPropertyValuesWithOptimizer(PojoTuplizer.java:203)
at org.hibernate.tuple.PojoTuplizer.setPropertyValues(PojoTuplizer.java:173)
at org.hibernate.persister.entity.BasicEntityPersister.setPropertyValues(BasicEntityPersister.java:2900)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:113)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:510)
at org.hibernate.loader.Loader.doQuery(Loader.java:419)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:210)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1312)
at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:116)
at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:101)
at org.hibernate.persister.entity.BasicEntityPersister.load(BasicEntityPersister.java:2461)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:350)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:331)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:113)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:167)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:79)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:617)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:610)
at org.springframework.orm.hibernate3.HibernateTemplate$1.doInHibernate(HibernateTemplate.java:386)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:310)
at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:380)
at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:375)
at com.abc.system.dao.hibernate.StepDAO.getStepById(StepDAO.java:48)
at com.abc.system.query.StepDAOTestCase.testSaveStep(StepDAOTestCase.java:58)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
Caused by: net.sf.cglib.beans.BulkBeanException: org.hibernate.collection.PersistentSet
I'm using Oracle 9.2.0.4.
I think the problem here is Hibernate is having trouble 'casting' a dbcolumn to a long[] within the context of a parent-child relationship
Any help is greatly appreciated.
|
|