Hi,
I'm using joined-subclass to inheritance. All works well until I try to persist a new instance of a subclass, then I get a PropertyValueException that seems to reference Hibernate's internal link from the subclass to the super-class.
Can anyone tell me how to make this work?
Thanks
Brian
Hibernate version: 3.1.3
Mapping documents:
<?xml version="1.0"?>
<!-- Contains mappings for Case and all its subclasses -->
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
>
<hibernate-mapping package="uk.co.barclays.dd.dto">
<class name="Case" table="dd_t_Cases">
<id name="id" column="CASE_ID" >
<generator class="sequence">
<param name="sequence">SEQ_DD_Cases</param>
</generator>
</id>
<property name="caseType" column="CASE_TYPE" />
<property name="description" column="DESCRIPTION" />
<!-- Query subclass -->
<joined-subclass name="GeneralQuery" table="DD_T_QUERIES">
<key column="CASE_ID"/>
<property name="text" column="QUERY_TEXT" />
</joined-subclass>
</class>
</hibernate-mapping>
Full stack trace of any exception that occurs:
org.hibernate.PropertyValueException: not-null property references a null or transient value: uk.co.barclays.dd.dto.Transfer._casesBackref
at org.hibernate.engine.Nullability.checkNullability(Nullability.java:72)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:265)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:114)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:530)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:518)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:514)
at uk.co.barclays.dd.dao.CaseDAO.add(CaseDAO.java:49)
Name and version of the database you are using:
Oracle 9i
The generated SQL (show_sql=true):
None
|