<?xml version="1.0" encoding='UTF-8'?>
<!DOCTYPE hibernate-mapping PUBLIC
                            "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
                            "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="com.itjob.dao.model">
    <class name="User" table="TUser">
        <id name="loginName" column="login_name" type="java.lang.String" length="50">
            <generator class="assigned"/>
        </id>
        <property name="userPasswd" column="user_passwd" type="java.lang.String" not-null="true" length= "50" />
        <property name="realName" column="real_name" type="java.lang.String" length= "50" />
        <property name="tel" column="tel" type="java.lang.String" length= "20" />
        <property name="email" column="email" type="java.lang.String" length= "100" />
        <property name="createTime" column="create_time" type="java.util.Date" not-null="true" />
        <property name="loginTime" column="login_time" type="java.util.Date" />
        <property name="lastLoginTime" column="last_login_time" type="java.util.Date" />
        <property name="loginTimes" column="login_times" type="java.lang.Integer" />
		<set name="roles" table="TUserRoleRelation" lazy="false" cascade="save-update">
			<key>
				<column name="login_name" not-null="true"/>
			</key>
			<many-to-many class="Role" column="role_id"/>
	    </set>
    </class>
</hibernate-mapping>
