<?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.InvoiceHasProduct" table="INVOICE_HAS_PRODUCT" catalog="prase">
        <composite-id name="id" class="com.arrebol.taxiservicios.model.stocktaking.InvoiceHasProductId">
            <key-property name="invoiceId" type="string">
                <column name="invoice_id" length="36" />
            </key-property>
            <key-property name="productId" type="string">
                <column name="product_id" length="36" />
            </key-property>
        </composite-id>
         <property name="price" type="float" not-null="true">
            <column name="price"/>
        </property>
        <property name="priceMenudeo" type="float" not-null="true">
            <column name="price_menudeo"/>
        </property>
        <property name="quantity" type="int">
            <column name="quantity"/>
        </property>
        <many-to-one name="invoice" class="com.arrebol.taxiservicios.model.stocktaking.Invoice" update="false" insert="false" fetch="select">
            <column name="invoice_id" length="36" not-null="true" />
        </many-to-one>
        <many-to-one name="product" class="com.arrebol.taxiservicios.model.catalog.Product" update="false" insert="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>
        
        <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>