<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping package="com.eplugger.shop.order.model">
 <class name="Order"
      table="omorder"
      dynamic-update="false">
   <id name="id" column="ORDERID">
         <generator class="uuid.hex"/>
   </id>
   <property name="serialNo" type="string" column="SERIALNO"/>
   <property name="orderDate" type="string" column="ORDERDATE"/>
   <property name="shipType" type="string" column="SHIPTYPE"/>
   <property name="payType" type="string" column="PAYTYPE"/>
   <property name="note" type="string" column="NOTE"/>
   <property name="totalCost" type="double" column="TOTALCOST"/>
   <property name="creator" type="string" column="CREATOR"/>
   <property name="status" type="string" column="status"/>
   <property name="productNumber" type="int" column="PRODUCTNUMBER"/>
   <one-to-one name="orderAddress" class="OrderAddress" cascade="all" outer-join="false"/>
   <one-to-one name="orderConsigneeAddress" class="OrderConsigneeAddress" cascade="all" outer-join="false"/>
   <property name="integralAmount" type="double" column="integral_amount"/>
   <property name="integral" type="int" column="integral"/>
   <property name="isIntegral" type="int" column="is_integral"/>
   <set
    name="childList"
    inverse="true"
    lazy="false"
    cascade="all">
    <key column="orderId"/>
    <one-to-many class="OrderDetail"/>
  </set>
  <set
    name="traces"
    order-by="createDate"
    inverse="true"
    lazy="false"
    cascade="all">
    <key column="orderId"/>
    <one-to-many class="OrderTracer"/>
  </set>
 </class>
 <class name="OrderAddress"
      table="orderaddress"
      dynamic-update="false">
		<id name="id" column="ORDERID">
      <generator class="foreign">
          <param name="property">order</param>
      </generator>
		</id>
     <property name="name" type="string" column="NAME"/>
     <property name="sex" type="boolean" column="SEX"/>
     <property name="zipCode" type="string" column="ZIPCODE"/>
     <property name="address" type="string" column="ADDRESS"/>
     <property name="telephone" type="string" column="TELEPHONE"/>
     <property name="mobileTelephone" type="string" column="MOBILETELEPHONE"/>
     <property name="emailAddress" type="string" column="EMAILADDRESS"/>
     <property name="areaNo" type="string" column="AREANO"/>
      <one-to-one name="order"  constrained="true" class="Order" outer-join="false"/>
   </class>
 <class name="OrderConsigneeAddress"
      table="order_consignee_address"
      dynamic-update="false">
		<id name="id" column="ORDERID">
      <generator class="foreign">
          <param name="property">order</param>
      </generator>
		</id>
     <property name="name" type="string" column="NAME"/>
     <property name="sex" type="boolean" column="SEX"/>
     <property name="zipCode" type="string" column="ZIPCODE"/>
     <property name="address" type="string" column="ADDRESS"/>
     <property name="telephone" type="string" column="TELEPHONE"/>
     <property name="mobileTelephone" type="string" column="MOBILETELEPHONE"/>
     <property name="emailAddress" type="string" column="EMAILADDRESS"/>
     <property name="areaNo" type="string" column="AREANO"/>
     <property name="province" type="string" column="PROVINCE"/>
     <property name="city" type="string" column="CITY"/>
      <one-to-one name="order"  constrained="true" class="Order" outer-join="false"/>
   </class>
	 <class name="OrderDetail"
      table="orderdetail"
      dynamic-update="false">
     <id name="id" column="uuid">
           <generator class="uuid.hex"/>
     </id>
     <property name="productId" type="string" column="PRODUCTID"/>
     <property name="productName" type="string" column="PRODUCTNAME"/>
     <property name="unitPrice" type="double" column="UNITPRICE"/>
     <property name="listPrice" type="double" column="LISTPRICE"/>
     <property name="unitType" type="string" column="UNITTYPE"/>
     <property name="quantity" type="int" column="QUANTITY"/>
     <property name="totalPrice" type="double" column="TOTALPRICE"/>
     <property name="orderDate" type="string" column="ORDER_DATE"/>
     <many-to-one name="omorder" column="orderId" not-null="true"/>
   </class>
   <class name="PayType" table="paytype" dynamic-update="false">
     <id name="id" column="PAYTYPEID">
           <generator class="uuid.hex"/>
     </id>
     <property name="name" type="string" column="NAME"/>
     <property name="note" type="string" column="NOTE"/>
     <property name="isnet" type="boolean" column="ISNET"/>
     <property name="shipTypeId" type="string" column="SHIPTYPEID"/>
		</class>
<class name="OrderTracer" table="ordertracer" dynamic-update="false">
	<id name="id" column="UUID">
		<generator class="uuid.hex"/>
	</id>
	<property name="operate" type="string" column="OPERATE"/>
	<property name="status" type="string" column="STATUS"/>
	<property name="creator" type="string" column="CREATOR"/>
	<property name="createDate" type="string" column="CREATEDATE"/>
    	 <many-to-one name="order" column="orderId" not-null="true"/>
</class>
   <class name="ShipType"
      table="shiptype"
      dynamic-update="false">
	   <id name="id" column="SHIPTYPEID">
	   	 <generator class="uuid.hex"/>
	   </id>
	   <property name="name" type="string" column="NAME"/>
	   <property name="note" type="string" column="NOTE"/>
     <property name="amount" type="int" column="AMOUNT"/>
     <property name="chargeType" type="string" column="charge_type"/>
<property name="shipAreaId" type="string" column="SHIPAREA_ID"/>
   </class>
   <class name="ShipPayRelation"
      table="shippay_relation"
      dynamic-update="false">
	   <id name="id" column="id">
	   	 <generator class="uuid.hex"/>
	   </id>
	   <property name="shipTypeId" type="string" column="shiptype_id"/>
	   <property name="payTypeId" type="string" column="paytype_id"/>
   </class>
<class name="GroupStock"
  table="groupstock"
  dynamic-update="false">
 <id name="id" column="id">
 	 <generator class="uuid.hex"/>
 </id>
 <property name="productId" type="string" column="product_id"/>
 <property name="productName" type="string" column="product_name"/>
 <property name="stockNumber" type="string" column="stock_number"/>
 <property name="contact" type="string" column="contact"/>
 <property name="phone" type="string" column="phone"/>
 <property name="note" type="string" column="note"/>
 <property name="createTime" type="string" column="create_time"/>
</class>
<class name="OOS"
  table="oos"
  dynamic-update="false">
 <id name="id" column="id">
 	 <generator class="uuid.hex"/>
 </id>
 <property name="creator" type="string" column="creator"/>
 <property name="contact" type="string" column="contact"/>
 <property name="productName" type="string" column="product_name"/>
 <property name="note" type="string" column="note"/>
 <property name="createTime" type="string" column="create_time"/>
</class>


</hibernate-mapping>

