<?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">
<!-- 
    Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
    <class where=" del=0 " name="cn.exlive.mygpsonline.bean.Vehicle" table="Vehicle" schema="dbo">
        <id name="id" type="java.lang.Integer">
            <column name="ID" />
            <generator class="native" />
        </id>
        <property name="mobileId" type="java.lang.Integer">
            <column name="MobileID" not-null="true" />
        </property>
        <property name="driverId" type="java.lang.Integer" insert="false" update="false">
            <column name="DriverID" />
        </property>
        <property name="vehicleTypeId" type="java.lang.Integer">
            <column name="VehicleTypeID" />
        </property>
        <property name="colorId" type="java.lang.Integer">
            <column name="ColorID" />
        </property>
        <property name="vhcCode" type="java.lang.String" update="false" insert="false" >
            <column name="车牌号码" length="30" not-null="true" />
        </property>
        <property name="simCode" type="java.lang.String" update="false" insert="false" >
            <column name="车机号码" length="16" not-null="true" />
        </property>
        <property name="gprsCode" type="java.lang.String" update="false" insert="false" >
            <column name="GPRS号码" length="16" not-null="true" />
        </property>
        <property name="voiceCode" type="java.lang.String">
            <column name="语音号码" length="50" />
        </property>
        <property name="dataCode" type="java.lang.String">
            <column name="数据号码" length="50" />
        </property>
        <property name="creater" type="java.lang.Integer">
            <column name="creater" not-null="true" />
        </property>
        <property name="loginpass" type="java.lang.String">
            <column name="loginpass" length="50" not-null="true" />
        </property>
        <property name="loginenable" type="java.lang.Integer">
            <column name="loginenable" not-null="true" />
        </property>
        <property name="isenable" type="java.lang.Integer">
            <column name="isenable" not-null="true" />
        </property>
        <property name="overduetime" type="java.util.Date">
            <column name="overduetime" length="23" not-null="true"/>
        </property>
        <property name="posavtime" type="java.util.Date" >
            <column name="posavtime" length="23" not-null="false" />
        </property>
        <property name="months" type="java.lang.Integer">
            <column name="months" not-null="true" />
        </property>
        <property name="pswstate" type="java.lang.Integer">
            <column name="pswstate" not-null="true" />
        </property>
        <property name="oilbox" type="java.lang.Integer">
            <column name="oilbox" not-null="true" />
        </property>
        <property name="del" type="java.lang.Integer">
            <column name="del" not-null="true" />
        </property>
        <property name="serverId" type="java.lang.Integer">
            <column name="serverId" not-null="true" />
        </property>
        <property name="icon" type="java.lang.Integer">
            <column name="icon" not-null="true" />
        </property>
         <property name="Aliases" type="java.lang.String" update="true" insert="false">
            <column name="Aliases" not-null="true" />
        </property>
         <property name="remark" type="java.lang.String" update="false" insert="false">
            <column name="remark" not-null="true" />
        </property>
        <property name="remark2" type="java.lang.String" update="false" insert="false">
            <column name="remark2"/>
        </property>
        <property name="installtime" type="java.util.Date">
            <column name="installtime" length="23" not-null="true" />
        </property>
        
        <property name="clientid" type="java.lang.Integer">
            <column name="ClientId" not-null="true" />
        </property>
        
         <property name="sccj" type="java.lang.String" update="false" insert="false">
            <column name="sccj" not-null="true" />
        </property>
        <one-to-one   name="positionLast"  class="cn.exlive.mygpsonline.bean.PositionLast" cascade="all" ></one-to-one>    
        <one-to-one  name="vehicleLast" class="cn.exlive.mygpsonline.bean.VehicleLast" cascade="all" ></one-to-one>        
    	<many-to-one name="driver"  class="cn.exlive.mygpsonline.bean.VehicleDriver" column="DriverID" lazy="false" not-found="ignore" foreign-key="none" fetch="join"></many-to-one>
    	<bag name="vhcItemizes" inverse="true" table="veh_Itemize_ids" lazy="false">
            <key foreign-key="none">
            	<!--name是中间表中的指向对方的属性的列名  -->
                <column name="vehicleid" />
            </key>
            <!-- column 是中间表对应本对象的外键id -->
            <many-to-many class="cn.exlive.mygpsonline.bean.VhcItemize" column="veh_Itemize" not-found="ignore" />
        </bag>
    </class>
</hibernate-mapping>
