<?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.catalog.Product" table="product" catalog="prase">
        <id name="id" type="string">
            <column name="id" length="36" />
            <generator class="assigned"></generator>
        </id>
        <property name="name" type="string">
            <column name="name" length="200" not-null="true"/>
        </property>
        <property name="code" type="string">
            <column name="code" length="50" not-null="true"/>
        </property>
        <property name="amount" type="double">
            <column name="amount"/>
        </property>
        <property name="amount2" type="double">
            <column name="amount2"/>
        </property>
        <property name="utility" type="double">
            <column name="utility"/>
        </property>
        <property name="utility2" type="double">
            <column name="utility2"/>
        </property>
        <property name="quantity" type="int">
            <column name="quantity"/>
        </property>
        <property name="quantity2" type="int">
            <column name="quantity_2"/>
        </property>
        <property name="life" type="int">
            <column name="life"/>
        </property>
        <property name="tipoUso" type="string">
            <column name="tipo_uso" length="250"/>
        </property>
        <property name="compatibilidad" type="string">
            <column name="compatibilidad" length="250"/>
        </property>
        <property name="activeStatus" column="activeStatus" 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="service" column="service" 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="herramienta" column="herramienta" 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="brand" class="com.arrebol.taxiservicios.model.catalog.Brand" not-null="true" fetch="select">
            <column name="brand_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>
        <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="claveUnidad" class="com.arrebol.taxiservicios.model.catalog.ClaveUnidad" fetch="select">
            <column name="clave_unidad" length="36"/>
        </many-to-one>
         <many-to-one name="claveProductoServicio" class="com.arrebol.taxiservicios.model.catalog.ClaveProductoServicio" fetch="select">
            <column name="clave_producto_servicio" length="36"/>
        </many-to-one>
        
        <set name="invoiceHasProducts" table="INVOICE_HAS_PRODUCT" inverse="true" lazy="true" fetch="select">
            <key>
                <column name="product_id" length="36" not-null="true" />
            </key>
            <one-to-many class="com.arrebol.taxiservicios.model.stocktaking.InvoiceHasProduct" />
        </set>
        <set name="serviceOrderHasProducts" table="SERVICE_ORDER_HAS_PRODUCT" inverse="true" lazy="true" fetch="select">
            <key>
                <column name="product_id" length="36" not-null="true" />
            </key>
            <one-to-many class="com.arrebol.taxiservicios.model.stocktaking.ServiceOrderHasProduct" />
        </set>
        <set name="productInvoiceBks" table="PRODUCT_INVOICE_BK" inverse="true" lazy="true" fetch="select">
            <key>
                <column name="product_id" length="36" not-null="true" />
            </key>
            <one-to-many class="com.arrebol.taxiservicios.model.stocktaking.ProductInvoiceBk" />
        </set>
    </class>
</hibernate-mapping>