<?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="Purchase" table="PURCHASE" 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="memo" column="MEMO" type="java.lang.String" />
        <property name="datee" column="DATEE" type="java.util.Date" not-null="true" />
        <property name="unpayedProductAmount" column="UNPAYED_PRODUCT_AMOUNT" type="java.lang.Double" />
        <property name="counts" column="COUNTS" type="java.lang.Integer" />
        <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="totalProductAmount" column="TOTAL_PRODUCT_AMOUNT" type="java.lang.Double" />
        <property name="freightAmount" column="FREIGHT_AMOUNT" type="java.lang.Double" />
        <property name="payedProductAmount" column="PAYED_PRODUCT_AMOUNT" type="java.lang.Double" />
        <property name="seq" column="SEQ" type="java.lang.String" />
        <many-to-one name="employ" column="EMPLOY_ID" class="Employ" not-null="true" />
        <many-to-one name="freight" column="FREIGHT_ID" class="Freight" />
        <many-to-one name="payInfo" column="PAY_INFO" class="InnerDefine" />
        <many-to-one name="supplier" column="SUPPLIER_ID" class="Supplier" />
        <set name="purchasePayDetailSet" inverse="true" cascade="all-delete-orphan" order-by="create_date desc">
            <key column="PURCHASE_ID" />
            <one-to-many class="PurchasePayDetail" />
        </set>
        <set name="purchaseProductDetailSet" inverse="true" cascade="all-delete-orphan" order-by="create_date desc">
            <key column="PURCHASE_ID" />
            <one-to-many class="PurchaseProductDetail" />
        </set>
    </class>
</hibernate-mapping>

