<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">

<!--

-->

<hibernate-mapping package="org.hibernate.test.event.collection.association.bidirectional.onetomany">

    <class name="ParentWithBidirectionalOneToMany" table="PARENT">
        <id name="id" column="ID" type="long">
            <generator class="native"/>
        </id>
        <bag name="children"
             inverse="true"
             cascade="all">
            <key column="parent_id"/>
            <one-to-many class="ChildWithManyToOne"/>
        </bag>
    </class>

    <class name="ChildWithManyToOne" table="CHILD">
        <id name="id" column="ID" type="long">
            <generator class="native"/>
        </id>
        <property name="name" column="NAME" type="string"/>
        <many-to-one name="parent" column="parent_id" class="ParentWithBidirectionalOneToMany" cascade="none"/>
    </class>

</hibernate-mapping>
