kgignatyev wrote:
<set name="addresses" table="person_addresses" cascade="all>
this doesn't work in my situation. I'm using oracle 10g along with hibernate 3.1.2
here is the mapping file:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="events.Event" table="EVENTS">
<id name="id" column="EVENT_ID">
<generator class="native"/>
</id>
<property name="date" type="timestamp" column="EVENT_DATE"/>
<property name="title"/>
<set name="eas" table="EVENT_ATTR" cascade="all">
<key column="EVENT_ID"/>
<composite-element class="events.EventAttr">
<property name="attr1" type="string" length="40" column="ATTR_1"/>
<property name="attr2" type="string" length="40" column="ATTR_2"/>
<property name="attr3" type="string" length="40" column="ATTR_3"/>
</composite-element>
</set>
</class>
</hibernate-mapping>
And I got this message when i delete Event object:
Caused by: java.sql.SQLException: ORA-02292: 违反完整约束条件 (TOR.FK59508C96F96D1A45) - 已找到子记录
you may not read chinese characters but you can see 'ORA-02292'