<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
    <class name="com.arrebol.taxiservicios.model.admin.Taxi" table="taxi" catalog="crov_spa">
        <id name="id" type="string">
            <column name="id" length="36" />
            <generator class="assigned"></generator>
        </id>
        <property name="placa" type="string">
            <column name="placa" length="12" not-null="true"/>
        </property>
        <property name="economicNumber" type="string">
            <column name="economic_number" length="12" not-null="true"/>
        </property>
        <property name="serialNumber" type="string">
            <column name="serial_number" length="60" not-null="true"/>
        </property>
        <property name="motorNmumber" type="string">
            <column name="motor_mumber" length="60" not-null="true"/>
        </property>
        <property name="comments" type="string">
            <column name="comments" length="200" not-null="true"/>
        </property>
        <property name="year" type="string">
            <column name="year" length="4" not-null="true"/>
        </property>
        <property name="insuranceNumber" type="string">
            <column name="insurance_number" length="50"/>
        </property>
        <property name="insuranceName" type="string">
            <column name="insurance_name" length="100"/>
        </property>
        <property name="insuranceCobertura" type="string">
            <column name="insurance_cobertura" length="100"/>
        </property>
        <property name="insuranceEndDate" type="date">
            <column name="insurance_end_date" length="10" />
        </property>
        <property name="km" type="float">
            <column name="km" />
        </property>
        <property name="kmMaintenance" type="float">
            <column name="km_maintenance" />
        </property>
        <property name="adeudo" type="float">
            <column name="adeudo_customer" />
        </property>
        <property name="platform" column="app_platform">
            <type name="org.hibernate.type.EnumType">
                <param name="enumClass">com.arrebol.taxiservicios.model.enums.PlatformType</param>
                <param name="useNamed">true</param>
            </type>
        </property>       
        <property name="monday" column="day_monday">
            <type name="org.hibernate.type.EnumType">
                <param name="enumClass">com.arrebol.taxiservicios.model.enums.BasicType</param>
                <param name="useNamed">true</param>
            </type>
        </property>
        <property name="tuesday" column="day_tuesday">
            <type name="org.hibernate.type.EnumType">
                <param name="enumClass">com.arrebol.taxiservicios.model.enums.BasicType</param>
                <param name="useNamed">true</param>
            </type>
        </property>
        <property name="wednesday" column="day_wednesday">
            <type name="org.hibernate.type.EnumType">
                <param name="enumClass">com.arrebol.taxiservicios.model.enums.BasicType</param>
                <param name="useNamed">true</param>
            </type>
        </property>
        <property name="thursday" column="day_thursday">
            <type name="org.hibernate.type.EnumType">
                <param name="enumClass">com.arrebol.taxiservicios.model.enums.BasicType</param>
                <param name="useNamed">true</param>
            </type>
        </property>
        <property name="friday" column="day_friday">
            <type name="org.hibernate.type.EnumType">
                <param name="enumClass">com.arrebol.taxiservicios.model.enums.BasicType</param>
                <param name="useNamed">true</param>
            </type>
        </property>
        <property name="saturday" column="day_saturday">
            <type name="org.hibernate.type.EnumType">
                <param name="enumClass">com.arrebol.taxiservicios.model.enums.BasicType</param>
                <param name="useNamed">true</param>
            </type>
        </property>
        <property name="sunday" column="day_sunday">
            <type name="org.hibernate.type.EnumType">
                <param name="enumClass">com.arrebol.taxiservicios.model.enums.BasicType</param>
                <param name="useNamed">true</param>
            </type>
        </property>
        <property name="payDay" type="double">
            <column name="pay_day"/>
        </property>
        <property name="paySaving" type="double">
            <column name="pay_saving"/>
        </property>
        <property name="payAccident" type="double">
            <column name="pay_accident"/>
        </property>
        <property name="paymentCar" type="double">
            <column name="payment_car"/>
        </property>
        <property name="active" type="java.lang.Boolean">
            <column name="active" sql-type="TINYINT" not-null="true"/>
        </property>
        <many-to-one name="vehicle" class="com.arrebol.taxiservicios.model.catalog.Vehicle" fetch="select">
            <column name="vehicle_id" length="36"/>
        </many-to-one>
        <many-to-one name="color" class="com.arrebol.taxiservicios.model.catalog.Color" fetch="select">
            <column name="color_id" length="36"/>
        </many-to-one>
        <many-to-one name="customer" class="com.arrebol.taxiservicios.model.core.Person" not-null="true" fetch="select">
            <column name="customer_id" length="36"/>
        </many-to-one>
        <many-to-one name="driver" class="com.arrebol.taxiservicios.model.core.Person" fetch="select">
            <column name="driver_id" length="36"/>
        </many-to-one>
        <many-to-one name="createdBy" class="com.arrebol.taxiservicios.model.core.User" not-null="true" fetch="select">
            <column name="created_by" length="36"/>
        </many-to-one>
        <property name="createdOn" type="timestamp">
            <column length="19" name="created_on"/>
        </property>
        <property name="deletedOn" type="timestamp">
            <column length="19" name="deleted_on"/>
        </property>
        <property name="commentsDeleted" type="string">
            <column name="comments_deleted" length="300"/>
        </property>
        <many-to-one name="lastUpdatedBy" class="com.arrebol.taxiservicios.model.core.User" fetch="select">
            <column name="last_updated_by" length="36"/>
        </many-to-one>
        <property name="lastUpdatedOn" type="timestamp">
            <column length="19" name="last_updated_on" />
        </property>
        <property name="gps" column="gps">
            <type name="org.hibernate.type.EnumType">
                <param name="enumClass">com.arrebol.taxiservicios.model.enums.BasicType</param>
                <param name="useNamed">true</param>
            </type>
        </property>
        <property name="apc" column="apc">
            <type name="org.hibernate.type.EnumType">
                <param name="enumClass">com.arrebol.taxiservicios.model.enums.BasicType</param>
                <param name="useNamed">true</param>
            </type>
        </property>
        <property name="gpsNumber" type="string">
            <column name="gps_number" length="20"/>
        </property>
        <many-to-one class="com.arrebol.taxiservicios.model.catalog.Location" fetch="select" name="location">
            <column length="36" name="id_location" not-null="false"/>
        </many-to-one>
        <property name="workDays" type="int">
            <column name="work_days" />
        </property>
        <set name="contracts" table="CONTRACT" inverse="true" lazy="true" fetch="select">
            <key>
                <column name="taxi_id" length="36" not-null="true" />
            </key>
            <one-to-many class="com.arrebol.taxiservicios.model.admin.Contract" />
        </set>
        
    </class>
</hibernate-mapping>