<?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>
<!-- 
    Created by the Middlegen Hibernate plugin 2.1

    http://boss.bekk.no/boss/middlegen/
    http://www.hibernate.org/
-->

<class 
    name="cn.com.xunuo.model.Plate" 
    table="plate"
>
    <meta attribute="class-description" inherit="false">
       @hibernate.class
        table="plate"
    </meta>

    <id
        name="id"
        type="java.lang.String"
        column="id"
        unsaved-value="null"
    >
        <meta attribute="field-description">
           @hibernate.id
            generator-class="uuid.hex"
            type="java.lang.String"
            column="id"

        </meta>
        <generator class="uuid.hex" />
    </id>

    <property
        name="parentid"
        type="java.lang.String"
        column="parentid"
        length="50"
    >
        <meta attribute="field-description">
           @hibernate.property
            column="parentid"
            length="50"
        </meta>    
    </property>

    <property
        name="name"
        type="java.lang.String"
        column="name"
        length="255"
    >
        <meta attribute="field-description">
           @hibernate.property
            column="name"
            length="255"
        </meta>    
    </property>

    <property
        name="status"
        type="java.lang.Integer"
        column="status"
        length="4"
    >
        <meta attribute="field-description">
           @hibernate.property
            column="status"
            length="4"
        </meta>    
    </property>

    <property
        name="serialnumber"
        type="java.lang.Long"
        column="serialnumber"
        length="38"
    >
        <meta attribute="field-description">
           @hibernate.property
            column="serialnumber"
            length="38"
        </meta>    
    </property>

    <property
        name="level"
        type="java.lang.Integer"
        column="level"
        length="4"
    >
        <meta attribute="field-description">
           @hibernate.property
            column="level"
            length="4"
        </meta>    
    </property>

    <property
        name="content"
        type="java.lang.String"
        column="content"
        length="2147483647"
    >
        <meta attribute="field-description">
           @hibernate.property
            column="content"
            length="2147483647"
        </meta>    
    </property>

    <property
        name="target"
        type="java.lang.String"
        column="target"
        length="50"
    >
        <meta attribute="field-description">
           @hibernate.property
            column="target"
            length="50"
        </meta>    
    </property>

    <property
        name="url"
        type="java.lang.String"
        column="url"
        length="255"
    >
        <meta attribute="field-description">
           @hibernate.property
            column="url"
            length="255"
        </meta>    
    </property>

    <property
        name="ifinter"
        type="java.lang.Integer"
        column="ifinter"
        length="4"
    >
        <meta attribute="field-description">
           @hibernate.property
            column="ifinter"
            length="4"
        </meta>    
    </property>

    <property
        name="filename"
        type="java.lang.String"
        column="filename"
        length="255"
    >
        <meta attribute="field-description">
           @hibernate.property
            column="filename"
            length="255"
        </meta>    
    </property>

    <property
        name="mansort"
        type="java.lang.String"
        column="mansort"
        length="50"
    >
        <meta attribute="field-description">
           @hibernate.property
            column="mansort"
            length="50"
        </meta>    
    </property>

    <property
        name="havefile"
        type="java.lang.Integer"
        column="havefile"
        length="4"
    >
        <meta attribute="field-description">
           @hibernate.property
            column="havefile"
            length="4"
        </meta>    
    </property>

    <property
        name="revisable"
        type="java.lang.Integer"
        column="revisable"
        length="4"
    >
        <meta attribute="field-description">
           @hibernate.property
            column="revisable"
            length="4"
        </meta>    
    </property>

    <property
        name="showtype"
        type="java.lang.Integer"
        column="showtype"
        length="4"
    >
        <meta attribute="field-description">
           @hibernate.property
            column="showtype"
            length="4"
        </meta>    
    </property>

    <property
        name="ifindex"
        type="java.lang.Integer"
        column="ifindex"
        length="4"
    >
        <meta attribute="field-description">
           @hibernate.property
            column="ifindex"
            length="4"
        </meta>    
    </property>
	<bag
            name="articles"
            table="article"
            lazy="true"
            inverse="true"
            cascade="save-update"
            order-by="serialnumber"
        >

              <key
                  column="parentid"
              >
              </key>

              <one-to-many
                  class="cn.com.xunuo.model.Article"
              />
        </bag>
        
        <bag
            name="inputUsers"
			table="sysuser_inputcolumn"
            lazy="true"
            inverse="false"
            cascade="none"
        >
              <key
                  column="columnid"
              >
              </key>

              <many-to-many
                  class="cn.com.xunuo.model.Sysuser"
				  column="userid"
              />
        </bag>
        <bag
            name="checkUsers"
			table="sysuser_checkcolumn"
            lazy="true"
            inverse="false"
            cascade="none"
        >

              <key
                  column="columnid"
              >
              </key>

              <many-to-many
                  class="cn.com.xunuo.model.Sysuser"
				  column="userid"
              />
        </bag>        
        <bag
            name="columnid1"
			table="plate_plate"
            lazy="true"
            inverse="false"
            cascade="none"
        >

              <key
                  column="columnid1"
              >
              </key>

              <many-to-many
                  class="cn.com.xunuo.model.Plate"
				  column="columnid2"
              />
        </bag>
        <bag
            name="columnid2"
			table="plate_plate"
            lazy="true"
            inverse="false"
            cascade="none"
        >

              <key
                  column="columnid2"
              >
              </key>

              <many-to-many
                  class="cn.com.xunuo.model.Plate"
				  column="columnid1"
              />
        </bag>
    <!-- Associations -->
  

</class>
</hibernate-mapping>



