<?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.stocktaking.ServiceOrderHasProduct" table="SERVICE_ORDER_HAS_PRODUCT" catalog="crov_inmobiliaria">
        <composite-id name="id" class="com.arrebol.taxiservicios.model.stocktaking.ServiceOrderHasProductId">
            <key-property name="serviceOrderId" type="string">
                <column name="service_order_id" length="36" />
            </key-property>
            <key-property name="productId" type="string">
                <column name="product_id" length="36" />
            </key-property>
        </composite-id>
        <property name="quantity" type="int" not-null="true">
            <column name="quantity"/>
        </property>
        <property name="price" type="float" not-null="true">
            <column name="price"/>
        </property>
        <property name="total" type="float" not-null="true">
            <column name="total"/>
        </property>
        <property name="mayoreo" type="float" not-null="true">
            <column name="mayoreo"/>
        </property>
        <property name="cobrado" column="cobrado" not-null="true">
            <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="financiado" column="financiado" not-null="true">
            <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 name="serviceOrder" class="com.arrebol.taxiservicios.model.stocktaking.ServiceOrder" insert="false" update="false" fetch="select">
            <column name="service_order_id" length="36" not-null="true" />
        </many-to-one>
        <many-to-one name="paymentClient" class="com.arrebol.taxiservicios.model.view.report.PaymentClient" insert="false" update="false" fetch="select">
            <column name="id_payment_client" length="36" />
        </many-to-one>
        <many-to-one name="product" class="com.arrebol.taxiservicios.model.catalog.Product" insert="false" update="false" fetch="select">
            <column name="product_id" length="36" not-null="true" />
        </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>
        <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>
        <many-to-one name="payCreatedBy" class="com.arrebol.taxiservicios.model.core.User" fetch="select">
            <column name="pay_created_by" length="36"/>
        </many-to-one>
        <property name="payDate" type="timestamp">
            <column length="19" name="pay_date"/>
        </property>
        <many-to-one name="financeCreatedBy" class="com.arrebol.taxiservicios.model.core.User"  fetch="select">
            <column name="finance_created_by" length="36"/>
        </many-to-one>
        <many-to-one name="expense" class="com.arrebol.taxiservicios.model.admin.Expense" fetch="select">
            <column name="id_expense" length="36"/>
        </many-to-one>
        <property name="financeDate" type="timestamp">
            <column length="19" name="finance_date"/>
        </property>
        <many-to-one name="paymentClientFinance" class="com.arrebol.taxiservicios.model.view.report.PaymentClient" insert="false" update="false" fetch="select">
            <column name="id_payment_client_finance" length="36" />
        </many-to-one>
        
        <property name="commercialInvoiceStatus" column="commercial_invoice_status" not-null="true">
            <type name="org.hibernate.type.EnumType">
                <param name="enumClass">com.arrebol.taxiservicios.model.enums.BasicType</param>
                <param name="useNamed">true</param>
            </type>
        </property>
        
    </class>
</hibernate-mapping>