<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: wangwei  
    $Date: 2015-5-21 下午8:52:48  
    $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="HLS_DOC_FILE_TEMPLET_SET_LN">
    <bm:fields>
        <bm:field name="templet_set_ln_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TEMPLET_SET_LN_ID" prompt="HLS_DOC_FILE_TEMPLET_SET_LN.TEMPLET_SET_LN_ID"/>
        <bm:field name="templet_set_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TEMPLET_SET_ID" prompt="HLS_DOC_FILE_TEMPLET_SET_LN.TEMPLET_SET_ID"/>
        <bm:field name="templet_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TEMPLET_ID" prompt="HLS_DOC_FILE_TEMPLET_SET_LN.TEMPLET_ID"/>
        <bm:field name="enabled_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLED_FLAG" prompt="HLS_DOC_FILE_TEMPLET_SET_LN.ENABLED_FLAG"/>
        <bm:field name="templet_code" expression="(select d.templet_code from HLS_DOC_FILE_TEMPLET d where d.templet_id=t1.templet_id)" forInsert="false" forUpdate="false"/>
        <bm:field name="templet_name" expression="(select d.templet_name from HLS_DOC_FILE_TEMPLET d where d.templet_id=t1.templet_id)" forInsert="false" forUpdate="false"/>
        <bm:field name="templet_file_name" expression="(select d.templet_file_name from HLS_DOC_FILE_TEMPLET d where d.templet_id=t1.templet_id)" forInsert="false" forUpdate="false"/>
    </bm:fields>
    <bm:features>
        <o:sequence-pk sequenceName="hls_doc_file_templet_set_ln_s"/>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="templet_set_ln_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="templet_set_id" queryOperator="="/>
    </bm:query-fields>
    <e:exception-descriptor-config>
        <e:exception-descriptor exception="java.sql.SQLException" handleClass="leaf.database.SQLExceptionDescriptor">
            <e:error-message code="1" message="存在重复的文件模板！"/>
        </e:exception-descriptor>
    </e:exception-descriptor-config>
</bm:model>
