Joined: Mon May 16, 2005 8:37 am Posts: 1 Location: Argentina
|
I have inheritance where any(no all) of the subclass has relations one-to-one with another class, when I want to persist object of a subclass that does not have relations one-to-one( class Pendiente) says the following thing to me:
java.lang.RuntimeException: org.hibernate.PropertyNotFoundException: Unable to resolve property [name=otorgamiento] to corresponding index at pruebas.persistencias.Iniciar.crearDictOficioCupo(Iniciar.java:120) at pruebas.persistencias.Iniciar.cargarDictamen(Iniciar.java:57) at pruebas.persistencias.Iniciar.main(Iniciar.java:46) Caused by: org.hibernate.PropertyNotFoundException: Unable to resolve property [name=otorgamiento] to corresponding index at org.hibernate.tuple.EntityMetamodel.getPropertyIndex(EntityMetamodel.java:294) at org.hibernate.tuple.AbstractTuplizer.getPropertyValue(AbstractTuplizer.java:199) at org.hibernate.persister.entity.BasicEntityPersister.getPropertyValue(BasicEntityPersister.java:2920) at org.hibernate.id.ForeignGenerator.generate(ForeignGenerator.java:35) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:85) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:184) at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:173) at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:477) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:472) at org.hibernate.id.ForeignGenerator.generate(ForeignGenerator.java:47) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:85) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:184) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:173) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:96) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69) at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:464) at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:459) at pruebas.persistencias.Iniciar.crearDictOficioCupo(Iniciar.java:115)
my mapping is this:
<hibernate-mapping>
<class name="ar.gov.gba.spb.dpdi.modelo.rgi.cupo.EstadoCupoInvolucrado">
<id name="id" column="id" type="long" >
<generator class="foreign">
<param name="property">anterior</param>
<param name="property">otorgamiento</param>
</generator>
</id>
<joined-subclass name="ar.gov.gba.spb.dpdi.modelo.rgi.cupo.Otorgado">
<key column="id"/>
<one-to-one name="anterior" class="ar.gov.gba.spb.dpdi.modelo.rgi.cupo.RechazadoOtorgamiento" cascade="none"
outer-join="auto" constrained="false"/>
</joined-subclass>
<joined-subclass name="ar.gov.gba.spb.dpdi.modelo.rgi.cupo.Cumplimentado">
<key column="id"
/>
<one-to-one name="otorgamiento" class="ar.gov.gba.spb.dpdi.modelo.rgi.cupo.Otorgado" cascade="none" outer-join="auto"
constrained="false"/>
</joined-subclass>
<joined-subclass name="ar.gov.gba.spb.dpdi.modelo.rgi.cupo.Pendiente" >
<key column="id"/>
</joined-subclass>
</class>
</hibernate-mapping>
I thank for the answers
|
|