Joined: Wed Dec 08, 2004 12:28 pm Posts: 8
|
I want to use Parent/Child-architectur with the <list>-element , but this makes some problems in Hibernate 3.0.5:
mappings:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate
<hibernate-mapping>
<class name="Parent" table="parent">
<id
name="id"
column="id"
unsaved-value="0"
>
<generator class="native"/>
</id>
<property name="name" column="name" type="string"/>
<list name="children" cascade="all" inverse="true">
<key column="parent_id" not-null="true"/>
<list-index column="idx"/>
<one-to-many class="Child"/>
</list>
</class>
<class name="Child" table="child">
<id
column="id"
name="id"
unsaved-value="0">
<generator class="native"/>
</id>
<property name="name" column="name" type="string"/>
<many-to-one name="parent" class="Parent" column="parent_id" not-null="true"/>
</class>
</hibernate-mapping>
But when in Parent-Mapping I exclude the inverse-attribut and in Child-Mapping I also exclude the many-to-one-Element all thing run good
Can someone tell me why this make problem ?
Thanks for advance..
|
|