<?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="Product" table="PRODUCT" optimistic-lock="version">
        <id name="id" column="ID" type="java.lang.String">
            <generator class="uuid.hex" />
        </id>
        <property name="version" column="VERSION" type="java.lang.Integer" />
        <property name="model" column="MODEL" type="java.lang.String" not-null="true" />
        <property name="price" column="PRICE" type="java.lang.Double" not-null="true" />
        <property name="name" column="NAME" type="java.lang.String" />
        <property name="sortId" column="SORT_ID" type="java.lang.Integer" />
        <property name="updateDate" column="UPDATE_DATE" type="java.util.Date" />
        <property name="createDate" column="CREATE_DATE" type="java.util.Date" />
        <property name="counts" column="COUNTS" type="java.lang.Integer" />
        <property name="memo" column="MEMO" type="java.lang.String" />
        <many-to-one name="productType" column="PRODUCT_TYPE_ID" class="ProductType" not-null="true" />
        <many-to-one name="supplier" column="SUPPLIER_ID" class="Supplier" not-null="true" />
        <set name="invalidProductSet" inverse="true" cascade="all-delete-orphan" order-by="create_date desc">
            <key column="PRODUCT_ID" />
            <one-to-many class="InvalidProduct" />
        </set>
        <set name="prepareReturnProductSet" inverse="true" cascade="all-delete-orphan" order-by="create_date desc">
            <key column="PRODUCT_ID" />
            <one-to-many class="PrepareReturnProduct" />
        </set>
        <set name="productChangeHistorySet" inverse="true" cascade="all-delete-orphan" order-by="create_date desc">
            <key column="PRODUCT_ID" />
            <one-to-many class="ProductChangeHistory" />
        </set>
        <set name="purchaseProductDetailSet" inverse="true" cascade="all-delete-orphan" order-by="create_date desc">
            <key column="PRODUCT_ID" />
            <one-to-many class="PurchaseProductDetail" />
        </set>
        <set name="purchaseReturnProductDetailSet" inverse="true" cascade="all-delete-orphan" order-by="create_date desc">
            <key column="PRODUCT_ID" />
            <one-to-many class="PurchaseReturnProductDetail" />
        </set>
        <set name="saleProductDetailSet" inverse="true" cascade="all-delete-orphan" order-by="create_date desc">
            <key column="PRODUCT_ID" />
            <one-to-many class="SaleProductDetail" />
        </set>
        <set name="saleReturnProductDetailSet" inverse="true" cascade="all-delete-orphan" order-by="create_date desc">
            <key column="PRODUCT_ID" />
            <one-to-many class="SaleReturnProductDetail" />
        </set>
    </class>
</hibernate-mapping>

