<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: ericyin  
    $Date: 2013-3-19 上午11:33:15  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:e="leaf.service.exception" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="AUT_OWNER_USER_AUTHORIZE">
    <bm:fields>
        <bm:field name="owner_user_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OWNER_USER_ID" prompt="AUT_OWNER_USER_AUTHORIZE.OWNER_USER_ID"/>
        <bm:field name="trx_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TRX_CATEGORY" prompt="AUT_OWNER_USER_AUTHORIZE.TRX_CATEGORY"/>
        <bm:field name="authorized_user_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="AUTHORIZED_USER_ID" prompt="AUT_OWNER_USER_AUTHORIZE.AUTHORIZED_USER_ID"/>
        <bm:field name="start_date" databaseType="DATE" datatype="java.util.Date" physicalName="START_DATE" prompt="AUT_OWNER_USER_AUTHORIZE.START_DATE"/>
        <bm:field name="end_date" databaseType="DATE" datatype="java.util.Date" physicalName="END_DATE" prompt="AUT_OWNER_USER_AUTHORIZE.END_DATE"/>
        <bm:field name="owner_user_desc" expression="(select description from sys_user_data_owner_v a where a.user_id=t1.owner_user_id)" forInsert="false" forUpdate="false"/>
        <bm:field name="owner_employee_name" expression="(select employee_name from sys_user_data_owner_v a where a.user_id=t1.owner_user_id)" forInsert="false" forUpdate="false"/>
        <bm:field name="authorized_user_desc" expression="(select description from sys_user_v a where a.user_id=t1.authorized_user_id)" forInsert="false" forUpdate="false"/>
        <bm:field name="authorized_employee_name" expression="(select employee_name from sys_user_v a where a.user_id=t1.authorized_user_id)" forInsert="false" forUpdate="false"/>
        <bm:field name="ref_v01" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V01" prompt="AUT_OWNER_USER_AUTHORIZE.REF_V01"/>
        <bm:field name="ref_v02" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V02" prompt="AUT_OWNER_USER_AUTHORIZE.REF_V02"/>
        <bm:field name="ref_v03" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V03" prompt="AUT_OWNER_USER_AUTHORIZE.REF_V03"/>
        <bm:field name="ref_v04" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V04" prompt="AUT_OWNER_USER_AUTHORIZE.REF_V04"/>
        <bm:field name="ref_v05" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V05" prompt="AUT_OWNER_USER_AUTHORIZE.REF_V05"/>
        <bm:field name="ref_n01" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N01" prompt="AUT_OWNER_USER_AUTHORIZE.REF_N01"/>
        <bm:field name="ref_n02" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N02" prompt="AUT_OWNER_USER_AUTHORIZE.REF_N02"/>
        <bm:field name="ref_n03" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N03" prompt="AUT_OWNER_USER_AUTHORIZE.REF_N03"/>
        <bm:field name="ref_n04" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N04" prompt="AUT_OWNER_USER_AUTHORIZE.REF_N04"/>
        <bm:field name="ref_n05" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N05" prompt="AUT_OWNER_USER_AUTHORIZE.REF_N05"/>
        <bm:field name="ref_d01" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D01" prompt="AUT_OWNER_USER_AUTHORIZE.REF_D01"/>
        <bm:field name="ref_d02" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D02" prompt="AUT_OWNER_USER_AUTHORIZE.REF_D02"/>
        <bm:field name="ref_d03" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D03" prompt="AUT_OWNER_USER_AUTHORIZE.REF_D03"/>
        <bm:field name="ref_d04" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D04" prompt="AUT_OWNER_USER_AUTHORIZE.REF_D04"/>
        <bm:field name="ref_d05" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D05" prompt="AUT_OWNER_USER_AUTHORIZE.REF_D05"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="authorized_user_id"/>
        <bm:pk-field name="owner_user_id"/>
        <bm:pk-field name="trx_category"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="trx_category" queryExpression="t1.trx_category=${@trx_category}"/>
        <bm:query-field field="authorized_user_id" queryExpression="t1.authorized_user_id=${@authorized_user_id}"/>
    </bm:query-fields>
    <e:exception-descriptor-config>
        <e:exception-descriptor exception="java.sql.SQLException" handleClass="leaf.database.SQLExceptionDescriptor">
            <e:error-message code="1" message="AUT105_UNIQUE_ERROR"/>
        </e:exception-descriptor>
    </e:exception-descriptor-config>
</bm:model>
