<?xml version="1.0" encoding='UTF-8'?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="com.jxc.domain.hbm">
    <class name="ProductType" table="PRODUCT_TYPE" optimistic-lock="version">
        <id name="id" column="ID" type="java.lang.String">
            <generator class="assigned" />
        </id>
        <property name="version" column="VERSION" type="java.lang.Integer" />
        <property name="name" column="NAME" type="java.lang.String" not-null="true" />
        <property name="sortId" column="SORT_ID" type="java.lang.Integer" />
        <property name="memo" column="MEMO" type="java.lang.String" />
        <property name="updateDate" column="UPDATE_DATE" type="java.util.Date" />
        <property name="createDate" column="CREATE_DATE" type="java.util.Date" />
        <many-to-one name="productType" column="PARENT_ID" class="ProductType" />
        <set name="productSet" inverse="true" cascade="all-delete-orphan" order-by="create_date desc">
            <key column="PRODUCT_TYPE_ID" />
            <one-to-many class="Product" />
        </set>
        <set name="productType1Set" inverse="true" cascade="all-delete-orphan" order-by="sort_id">
            <key column="PARENT_ID" />
            <one-to-many class="ProductType" />
        </set>
    </class>
</hibernate-mapping>

