<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-3-29 上午10:10:19  
    $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="FND_SCORE_TARGET_TYPE_TABLE">
    <bm:fields>
        <bm:field name="target_type_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TARGET_TYPE_CODE" prompt="FND711.FND_SCORING_TARGET_TYPE.TARGET_TYPE_CODE"/>
        <bm:field name="table_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TABLE_NAME" prompt="FND711.FND_SCORE_TARGET_TYPE_TABLE.TABLE_NAME"/>
        <bm:field name="table_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TABLE_DESC" prompt="FND711.FND_SCORE_TARGET_TYPE_TABLE.TABLE_DESC"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:operations>
        <bm:operation name="delete">
            <bm:update-sql><![CDATA[
    			begin
    			   fnd_score_define_pkg.type_table_delete(p_target_type_code => ${@target_type_code},
							                              p_table_name       => ${@table_name},
							                              p_user_id          => ${/session/@user_id});
    			end;
    		]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:primary-key>
        <bm:pk-field name="table_name"/>
        <bm:pk-field name="target_type_code"/>
    </bm:primary-key>
    <e:exception-descriptor-config>
        <e:exception-descriptor exception="java.sql.SQLException" handleClass="leaf.database.SQLExceptionDescriptor">
            <e:error-message code="1" message="FND711.ERROR_MESSAGE.TABLE_NAME_REPEATED"/>
        </e:exception-descriptor>
    </e:exception-descriptor-config>
    <bm:data-filters>
        <bm:data-filter name="target_type_code" enforceOperations="query" expression="target_type_code=${@target_type_code}"/>
    </bm:data-filters>
</bm:model>
