<?xml version="1.0" encoding="UTF-8"?>
<!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.core.Person" table="person" catalog="prase">
        <id name="id" type="string">
            <column name="id" length="36" />
            <generator class="assigned"></generator>
        </id>
        <property name="firstName" type="string">
            <column name="first_name" length="25" not-null="true" />
        </property>
        <property name="secondName" type="string">
            <column name="second_name" length="25" />
        </property>
        <property name="lastName" type="string">
            <column name="last_name" length="25" />
        </property>
        <property name="middleName" type="string">
            <column name="middle_name" length="25" />
        </property>
        <property name="mail" type="string">
            <column name="mail" length="200"/>
        </property>
        <property name="birthdate" type="timestamp">
            <column name="birthdate" length="10" />
        </property>
        <property name="curp" type="string">
            <column name="curp" length="20" />
        </property>
        <property name="rfc" type="string">
            <column name="rfc" length="13" />
        </property>
        <property name="avatar" type="string">
            <column name="avatar" length="150" />
        </property>
        <property name="personType" column="person_type" not-null="true">
            <type name="org.hibernate.type.EnumType">
                <param name="enumClass">com.arrebol.taxiservicios.model.enums.PersonType</param>
                <param name="useNamed">true</param>
            </type>
        </property>
        <property name="payment" type="float">
            <column name="payment" />
        </property>
        <property name="paymentType" column="payment_type">
            <type name="org.hibernate.type.EnumType">
                <param name="enumClass">com.arrebol.taxiservicios.model.enums.PaymentType</param>
                <param name="useNamed">true</param>
            </type>
        </property>
        <property name="license" type="string">
            <column name="license" length="20" />
        </property>
        <property name="expirationLicenseDate" type="timestamp">
            <column name="expiration_license" length="10" />
        </property>
        <property name="ife" type="string">
            <column name="ife" length="20" />
        </property>
        <property name="retainer" type="float">
            <column name="retainer" />
        </property>
        <property name="admissionDate" type="date">
            <column name="admission_date" length="10" />
        </property>
        <property name="active" type="java.lang.Boolean">
            <column name="active" sql-type="TINYINT" not-null="true"/>
        </property>
        <property name="blackList" column="black_list">
            <type name="org.hibernate.type.EnumType">
                <param name="enumClass">com.arrebol.taxiservicios.model.enums.GenericEnumType</param>
                <param name="useNamed">true</param>
            </type>
        </property>
        <property name="blackListDescription" type="string">
            <column name="black_list_description" length="500" />
        </property>
        <property name="root" type="java.lang.Boolean">
            <column name="root" sql-type="TINYINT"/>
        </property>
        <property name="adeudo" type="float">
            <column name="adeudo" />
        </property>
        <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>
        <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="nameEndorsement" type="string">
            <column name="name_endorsement" length="500" />
        </property>
        <property name="parentescoEndorsement" type="string">
            <column name="parentesco_endorsement" length="500" />
        </property>
        <property name="phoneEndorsement" type="string">
            <column name="phone_endorsement" length="500" />
        </property>
        
        <property name="juridico" column="juridico">
            <type name="org.hibernate.type.EnumType">
                <param name="enumClass">com.arrebol.taxiservicios.model.enums.BasicType</param>
                <param name="useNamed">true</param>
            </type>
        </property>
        
        <many-to-one class="com.arrebol.taxiservicios.model.catalog.Location" fetch="select" name="location">
            <column length="36" name="id_location" not-null="true"/>
        </many-to-one>
        
        <many-to-one class="com.arrebol.taxiservicios.model.catalog.RegimenFiscal" fetch="select" name="regimenFiscal">
            <column length="36" name="regimen_fiscal" not-null="false"/>
        </many-to-one>
        
        <property name="salary" type="double">
            <column name="salary" />
        </property>
        
        <property name="imss" type="double">
            <column name="imss" />
        </property>
        
        <property name="saving" type="double">
            <column name="saving" />
        </property>
        
        <property name="savingWeek" type="double">
            <column name="saving_week" />
        </property>
        
        <property name="telefono" type="string">
            <column name="telefono" length="20" />
        </property>

        <property name="direccion" type="string">
            <column name="direccion"/>
        </property>
        
        <property name="ajustador" type="java.lang.Boolean" not-null="true">
            <column name="ajustador" sql-type="TINYINT"/>
        </property>        
        
        <many-to-one class="com.crov.prase.model.catalog.Despacho" fetch="select" name="despacho">
            <column length="36" name="id_despacho" not-null="false"/>
        </many-to-one>
        
    </class>
</hibernate-mapping>
