<?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.product.model">
  <class name="Product"
    table="product"
    dynamic-update="false">
    <id name="id" column="PRODUCT_ID">
        <generator class="uuid.hex"/>
    </id>
    <property name="name" type="string" column="PRODUCT_NAME"/>
    <property name="unitPrice" type="double" column="UNIT_PRICE"/>
    <property name="listPrice" type="double" column="LIST_PRICE"/>
    <property name="quantity" type="int" column="QUANTITY"/>
    <property name="brand" type="string" column="BRAND"/>
    <property name="model" type="string" column="MODEL"/>
    <property name="spec" type="string" column="Spec"/>
    <property name="unit" type="string" column="UNIT"/>
    <property name="manufactory" type="string" column="MANUFACTORY"/>
    <property name="producingArea" type="string" column="PRODUCINGAREA"/>
    <property name="reseller" type="string" column="RESELLER"/>
    <property name="createTime" type="string" column="CREATE_TIME"/>
    <property name="updateTime" type="string" column="UPDATE_TIME"/>
    <property name="description" type="string" column="DESCRIPTION"/>
    <property name="bigPicture" type="string" column="BIG_PICTURE"/>
    <property name="smallPicture" type="string" column="SMALL_PICTURE"/>
    <property name="centerPicture" type="string" column="CENTER_PICTURE"/>
    <property name="popPicture" type="string" column="POP_PICTURE"/>
    <property name="note" type="string" column="note"/>
    <property name="templateId" type="string" column="TEMPLATE_ID"/>
    <property name="status" type="boolean" column="STATUS"/>
    <property name="key" type="string" column="SEARCHKEY"/>
    <property name="mainCategory" type="string" column="MAIN_CATEGORY"/>
    <property name="productNo" type="string" column="PRODUCT_NO"/>
    <property name="displayId" type="string" column="displayId"/>
    <property name="index" type="int" column="SORTINDEX"/>
    <property name="corpId" type="string" column="corpid"/>
    <property name="linkurl" type="string" column="LINKURL"/>
    <property name="extField1" type="string" column="EXT_FIELD1"/>
    <property name="extField2" type="string" column="EXT_FIELD2"/>
    <property name="specName1" type="string" column="spec_name1"/>
    <property name="specName2" type="string" column="spec_name2"/>
    <property name="specValue1" type="string" column="spec_value1"/>
    <property name="specValue2" type="string" column="spec_value2"/>
  </class>
  <class name="ProductCategory" table="productcategory" dynamic-update="false">
    <id name="id" column="CATEGORY_ID">
        <generator class="uuid.hex"/>
    </id>
    <property name="categoryName" type="string" column="CATEGORY_NAME"/>
    <property name="categoryEnName" type="string" column="CATEGORY_EN_NAME"/>
    <property name="categoryLevel" type="string" column="CATEGORY_LEVEL"/>
    <property name="parentId" type="string" column="PARENT_ID"/>
    <property name="index" type="int" column="POSITION"/>
    <property name="type" type="string" column="TYPE"/>
    <property name="channelId" type="string" column="CHANNELID"/>
    <property name="description" type="string" column="DESCRIPTION"/>
    <property name="navImage" type="string" column="NAV_IMAGE"/>
    <property name="popProduct" type="string" column="POP_PRODUCT"/>
    <property name="linkUrl" type="string" column="LINKURL"/>
  </class>
  <class name="ProductCategoryRelation" table="product_category_relation" dynamic-update="false">
    <id name="id" column="UUID">
      <generator class="uuid.hex"/>
    </id>
    <property name="categoryId" type="string" column="CATEGORY_ID"/>
    <property name="productId" type="string" column="PRODUCT_ID"/>
  </class>
	<class name="ProductRelation" table="product_relation" dynamic-update="false">
    <id name="id" column="UUID">
      <generator class="uuid.hex"/>
    </id>
    <property name="productId" type="string" column="PRODUCT_ID"/>
    <property name="reproductId" type="string" column="RE_PRODUCT_ID"/>
  </class>
  <class name="ProductModel" table="PRODUCT_MODEL" dynamic-update="false">
    <id name="id" column="UUID">
      <generator class="uuid.hex"/>
    </id>
    <property name="productId" type="string" column="PRODUCT_ID"/>
    <property name="modelName" type="string" column="MODEL_NAME"/>
    <property name="modelPrice" type="double" column="MODEL_PRICE"/>
    <property name="specValue1" type="string" column="spec_value1"/>
    <property name="specValue2" type="string" column="spec_value2"/>
  </class>

  <class name="ProductTemplate" table="pmtemplate" dynamic-update="false">
    <id  name="id" column="id" type="string">
      <generator class="uuid.hex"/>
    </id>
    <property name="name" type="string" column="name"/>
    <property name="description" type="string" column="description"/>
    <set
      name="childList"
      inverse="true"
      lazy="false"
      order-by="type asc, name asc"
      cascade="all">
      <key column="templateId"/>
      <one-to-many class="ProductTemplateFields"/>
    </set>
  </class>
  <class name="ProductTemplateFields" table="pmtemplatefields" dynamic-update="false">
    <id  name="id" column="id" type="string" >
         <generator class="uuid.hex"/>
    </id>
    <property name="name" type="string" column="name"/>
    <property name="displayName" type="string" column="displayName"/>
    <property name="type" type="string" column="type"/>
    <property name="display" type="string" column="isDisplay"/>
    <many-to-one name="template" class="ProductTemplate" column="templateId" not-null="true" outer-join="false"/>
  </class>
  <class name="TemplateBlobField"
        table="templateblobfield"
        dynamic-update="false">
    <id  name="id" column="id" type="string" >
         <generator class="uuid.hex"/>
    </id>
    <property name="productId" type="string" column="product_id"/>
    <property name="fieldId" type="string" column="field_id"/>
    <property name="fieldValue" type="string" column="field_value"/>
  </class>
  <class name="TemplateTextField"
        table="templatetextfield"
        dynamic-update="false">
    <id  name="id" column="id" type="string" >
         <generator class="uuid.hex"/>
    </id>
               <property name="productId" type="string" column="product_id"/>
    <property name="fieldId" type="string" column="field_id"/>
    <property name="fieldValue" type="string" column="field_value"/>
  </class>
  <class name="TemplateCategory"
      table="templatefieldcategory"
      dynamic-update="false">
    <id  name="id" column="id" type="string" >
         <generator class="assigned"/>
    </id>
    <property name="name" type="string" column="name"/>
    <property name="type" type="string" column="type"/>
  </class>
<class name="ProductAppraisal"
    table="product_appraisal"
    dynamic-update="false">
  <id  name="id" column="uuid" type="string" >
       <generator class="uuid.hex"/>
  </id>
  <property name="productId" type="string" column="productId"/>
  <property name="appLevel" type="int" column="APP_LEVEL"/>
	<property name="description" type="string" column="DESCRIPTION"/>
	<property name="appTime" type="string" column="APP_TIME"/>
	<property name="appUser" type="string" column="APP_USER"/>
	<property name="good" type="string" column="good"/>
	<property name="shortArea" type="string" column="short_area"/>
	<property name="createTime" type="string" column="create_time"/>
	<property name="subject" type="string" column="subject"/>
</class>
</hibernate-mapping>

