<?xml version="1.0" encoding="UTF-8"?>
<hibernate-mapping xmlns="http://www.hibernate.org/xsd/hibernate-mapping"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://www.hibernate.org/xsd/hibernate-mapping
		http://www.hibernate.org/xsd/hibernate-mapping/hibernate-mapping-4.0.xsd">
    <class entity-name="com.xyst.dinas.biz.datamodel.Station" table="xyst_dinas_biz_station" optimistic-lock="version">
        <tuplizer entity-mode="dynamic-map" class="com.beecode.bcp.store.hibernate.KObjectEntityTuplizer"/>
        <id name="id" type="uuid-binary" column="id" length="16">
            <generator class="assigned" />
        </id>
        <version name="version" type="int" column="version"/>
        <property name="createTime" type="timestamp" not-null="false">
            <column name="create_time"/>
        </property>
        <many-to-one name="creator" entity-name="com.beecode.bap.staff.datamodel.Staff" fetch="select">
            <column name="creator_id"  not-null="false"/>
        </many-to-one>
        <property name="modifyTime" type="timestamp" not-null="false">
            <column name="modify_time"/>
        </property>
        <many-to-one name="modifier" entity-name="com.beecode.bap.staff.datamodel.Staff" fetch="select">
            <column name="modifier_id"  not-null="false"/>
        </many-to-one>
        <property name="billState" type="nstring" not-null="false">
            <column name="bill_state" length="100"/>
        </property>
        <many-to-one name="bizProcess" entity-name="com.beecode.bap.workflow.datamodel.BizProcess" fetch="select">
            <column name="biz_process_id"  not-null="false"/>
        </many-to-one>
        <property name="billCode" type="nstring" not-null="false">
            <column name="bill_code" length="200"/>
        </property>
        <property name="discard" type="boolean" not-null="false">
            <column name="discard"/>
        </property>
        <property name="del" type="boolean" not-null="false">
            <column name="del"/>
        </property>
        <property name="approveState" type="integer" not-null="false">
            <column name="approve_state"/>
        </property>

        <many-to-one name="regionalCompany" entity-name="com.xyst.dinas.biz.datamodel.xystOrganization" fetch="select">
            <column name="regional_company"  not-null="false">
                <comment>所属部门</comment>
            </column>
        </many-to-one>
        <property name="stationName" type="nstring" not-null="true">
            <column name="station_name" length="30"  >
                <comment>场站名称</comment>
            </column>
        </property>
        <property name="stationAddress" type="nstring" length="80"  not-null="false">
            <column name="station_address">
                <comment>场站地址</comment>
            </column>
        </property>
        <property name="stationStatus" type="integer" not-null="true">
            <column name="station_status" >
                <comment>场站状态,0已停业1经营中</comment>
            </column>
        </property>
        <property name="stationCoordinate" type="nstring" not-null="false">
            <column name="station_coordinate">
                <comment>场站的坐标按照逗号分隔</comment>
            </column>
        </property>
        <property name="linkMan" type="nstring" not-null="false">
            <column name="link_man">
                <comment>联系人</comment>
            </column>
        </property>
        <property name="openingDate" type="timestamp" not-null="false">
            <column name="opening_date">
                <comment>开业时间</comment>
            </column>
        </property>
        <property name="telephone" type="nstring" not-null="false">
            <column name="telephone" length="50">
                <comment>联系方式</comment>
            </column>
        </property>
        <property name="reason" type="nstring" not-null="false">
            <column name="reason" length="300" >
                <comment>备注</comment>
            </column>
        </property>
        <property name="sortOrder" type="int" not-null="true"  unique="true" index="station_sort_index" >
            <column name="sort_order" length="10">
                <comment >排序</comment>
            </column>
        </property>
        <bag name="productionLines" lazy="true" fetch="select" inverse="true">
            <key column="station_id" not-null="true" />
            <one-to-many entity-name="com.xyst.dinas.biz.datamodel.ProductionLine" />
        </bag>
    </class>
    <class entity-name="com.xyst.dinas.biz.datamodel.ProductionLine" table="xyst_dinas_biz_production_Line">
        <tuplizer entity-mode="dynamic-map" class="com.beecode.bcp.store.hibernate.KObjectEntityTuplizer"/>
        <id name="id" type="uuid-binary" column="id" length="16">
            <generator class="assigned" />
        </id>
        <many-to-one name="station" entity-name="com.xyst.dinas.biz.datamodel.Station" fetch="select" >
            <column name="station_id"  not-null="false" >
                <comment>所属场站</comment>
            </column>
        </many-to-one>
        <property name="name" type="nstring" not-null="false">
            <column name="name">
                <comment>名称</comment>
            </column>
        </property>
    </class>
</hibernate-mapping>