<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2013-8-2 下午06:42:18  
    $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="HLS_DOC_LAYOUT_TAB_BUTTON" defaultOrderBy="t1.display_order">
    <bm:fields>
        <bm:field name="function_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FUNCTION_CODE" prompt="HLS_DOC_LAYOUT_TAB_BUTTON.FUNCTION_CODE"/>
        <bm:field name="layout_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LAYOUT_CODE" prompt="HLS_DOC_LAYOUT_TAB_BUTTON.LAYOUT_CODE"/>
        <bm:field name="tab_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TAB_CODE" prompt="HLS_DOC_LAYOUT_TAB_BUTTON.TAB_CODE"/>
        <bm:field name="button_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUTTON_CODE" prompt="HLS_DOC_LAYOUT_TAB_BUTTON.BUTTON_CODE"/>
        <bm:field name="prompt" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROMPT" prompt="HLS_DOC_LAYOUT_TAB_BUTTON.PROMPT"/>
        <bm:field name="save_data_first" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SAVE_DATA_FIRST" prompt="HLS_DOC_LAYOUT_TAB_BUTTON.SAVE_DATA_FIRST"/>
        <bm:field name="system_flag" databaseType="VARCHAR2" datatype="java.lang.String" expression="nvl(t1.system_flag,&apos;N&apos;)" physicalName="SYSTEM_FLAG" prompt="HLS_DOC_LAYOUT_TAB_BUTTON.SYSTEM_FLAG"/>
        <bm:field name="display_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DISPLAY_FLAG" prompt="HLS_DOC_LAYOUT_TAB_BUTTON.DISPLAY_FLAG"/>
        <bm:field name="display_order" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DISPLAY_ORDER" prompt="HLS_DOC_LAYOUT_TAB_BUTTON.DISPLAY_ORDER"/>
        <bm:field name="javascript" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="JAVASCRIPT" prompt="HLS_DOC_LAYOUT_TAB_BUTTON.JAVASCRIPT"/>
        <bm:field name="enabled_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLED_FLAG" prompt="HLS_DOC_LAYOUT_TAB_BUTTON.ENABLED_FLAG"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:operations>
        <bm:operation name="execute">
            <bm:update-sql><![CDATA[
            BEGIN
                hls_doc_layout_button_pkg.tab_button_config_load(p_layout_code   =>${@layout_code},
				                                                 p_tab_code      =>${@tab_code},
				                                                 p_function_code =>${@function_code},
				                                                 p_user_id       =>${/session/@user_id});
            END;
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:primary-key>
        <bm:pk-field name="button_code"/>
        <bm:pk-field name="function_code"/>
        <bm:pk-field name="layout_code"/>
        <bm:pk-field name="tab_code"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="button_code" queryOperator="like"/>
        <bm:query-field field="function_code" queryOperator="="/>
        <bm:query-field field="layout_code" queryOperator="="/>
        <bm:query-field field="tab_code" queryOperator="="/>
        <bm:query-field field="prompt" queryOperator="like"/>
        <bm:query-field name="enabled_flag" queryExpression="(t1.enabled_flag=${@enabled_flag} or ${@enabled_flag}=&apos;ALL&apos;)"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="t1.function_code=${@function_code} and t1.layout_code=${@layout_code} and t1.tab_code=${@tab_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="HLS030_SAVE_PKG.BUTTON_DESC_UNIQUE_ERROR"/>
        </e:exception-descriptor>
    </e:exception-descriptor-config>
</bm:model>
