<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
    <class name="com.zds.slms.domain.Employee" table="employee" >
        <id name="id" type="java.lang.Integer">
            <column name="id" />
            <generator class="identity" />
        </id>
        <property name="code" type="string">
            <column name="code" length="3" not-null="true">
                <comment>员工编号</comment>
            </column>
        </property>
        <property name="name" type="string">
            <column name="name" length="10" not-null="true">
                <comment>姓名</comment>
            </column>
        </property>
        <property name="birthday" type="string">
            <column name="birthday" length="10" not-null="true">
                <comment>出生日期</comment>
            </column>
        </property>
        <property name="sex" type="boolean">
            <column name="sex" not-null="true">
                <comment>性别(0-女，1-男)</comment>
            </column>
        </property>
        <property name="telephone" type="string">
            <column name="telephone" length="30" not-null="true">
                <comment>电话</comment>
            </column>
        </property>
        <property name="email" type="string">
            <column name="email" length="30">
                <comment>电子邮件</comment>
            </column>
        </property>
        <set name="stockins" table="stockin" inverse="true" lazy="true" fetch="select" cascade="all-delete-orphan">
            <key>
                <column name="employeeid" not-null="true" />
            </key>
            <one-to-many class="com.zds.slms.domain.Stockin" />
        </set>
        <set name="stockorders" table="stockorder" inverse="true" lazy="true" fetch="select" cascade="all-delete-orphan">
            <key>
                <column name="handleoperatorid" not-null="true">
                    <comment>订货单</comment>
                </column>
            </key>
            <one-to-many class="com.zds.slms.domain.Stockorder" />
        </set>
    </class>
</hibernate-mapping>
