<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-3-21 上午11:36:47  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:e="leaf.service.exception" xmlns:o="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="SCH_TASK_PARAMETER" defaultOrderBy="seq">
    <bm:fields>
        <bm:field name="parameter_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PARAMETER_ID" prompt="SCH102.SCH_TASK_PARAMETER.PARAMETER_ID"/>
        <bm:field name="task_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TASK_CODE" prompt="SCH102.SCH_TASK.TASK_CODE"/>
        <bm:field name="seq" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SEQ" prompt="SCH102.SCH_TASK_PARAMETER.SEQ"/>
        <bm:field name="parameter_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PARAMETER_NAME" prompt="SCH102.SCH_TASK_PARAMETER.PARAMETER_NAME"/>
        <bm:field name="parameter_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PARAMETER_TYPE" prompt="SCH102.SCH_TASK_PARAMETER.PARAMETER_TYPE"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION" prompt="SCH102.SCH_TASK_PARAMETER.DESCRIPTION"/>
        <bm:field name="edit_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EDIT_TYPE" prompt="SCH102.SCH_TASK_PARAMETER.EDIT_TYPE"/>
        <bm:field name="default_value" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DEFAULT_VALUE" prompt="SCH102.SCH_TASK_PARAMETER.DEFAULT_VALUE"/>
        <bm:field name="display_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DISPLAY_FLAG" prompt="SCH102.SCH_TASK_PARAMETER.DISPLAY_FLAG"/>
        <bm:field name="display_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DISPLAY_TYPE" prompt="SCH102.SCH_TASK_PARAMETER.DISPLAY_TYPE"/>
        <bm:field name="lov_sql" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LOV_SQL" prompt="SCH102.SCH_TASK_PARAMETER.LOV_SQL"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="delete">
            <bm:update-sql><![CDATA[
    			begin
    				 sch_task_pkg.parameter_delete(p_parameter_id 	=> ${@parameter_id},
    											   p_user_id		=> ${/session/@user_id});
    			end;
    		]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="execute">
            <bm:update-sql><![CDATA[
    			begin
    				 sch_task_pkg.parameter_check_max_count(p_task_code => ${@task_code},
    														p_user_id	=> ${/session/@user_id});
    			end;
    		]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="parameter_id"/>
    </bm:primary-key>
    <bm:data-filters>
        <bm:data-filter name="task_code" enforceOperations="query" expression="task_code=${@task_code}"/>
    </bm:data-filters>
    <e:exception-descriptor-config>
        <e:exception-descriptor exception="java.sql.SQLException" handleClass="leaf.database.SQLExceptionDescriptor">
            <e:error-message code="1" message="SCH102.ERROR_MESSAGE.SEQ_OR_PARAMETER_NAME_REPEATED"/>
        </e:exception-descriptor>
    </e:exception-descriptor-config>
</bm:model>
