<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-4-19 下午2:10:34  
    $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_CASHFLOW_ITEM">
    <bm:fields>
        <bm:field name="cf_item" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CF_ITEM" prompt="HLS005.HLS_CASHFLOW_ITEM.CF_ITEM"/>
        <bm:field name="cf_type" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CF_TYPE" prompt="HLS005.HLS_CASHFLOW_TYPE.CF_TYPE"/>
        <bm:field name="cf_type_desc" forInsert="false" forUpdate="false" prompt="HLS005.HLS_CASHFLOW_TYPE.DESCRIPTION"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION" prompt="HLS005.HLS_CASHFLOW_ITEM.DESCRIPTION"/>
        <bm:field name="reserved_flag" databaseType="VARCHAR2" datatype="java.lang.String" forUpdate="false" insertExpression="&apos;N&apos;" physicalName="RESERVED_FLAG" prompt="HLS005.HLS_CASHFLOW_ITEM.RESERVED_FLAG"/>
        <bm:field name="system_flag" databaseType="VARCHAR2" datatype="java.lang.String" forUpdate="false" insertExpression="&apos;N&apos;" physicalName="SYSTEM_FLAG" prompt="HLS005.HLS_CASHFLOW_ITEM.SYSTEM_FLAG"/>
        <bm:field name="enabled_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLED_FLAG" prompt="HLS.ENABLED_FLAG"/>
        <bm:field name="cf_direction" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CF_DIRECTION"/>
        <bm:field name="cf_direction_desc" forInsert="false" forUpdate="false" prompt="HLS005.HLS_CASHFLOW_TYPE.CF_DIRECTION"/>
        <bm:field name="write_off_order" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WRITE_OFF_ORDER" prompt="HLS005.HLS_CASHFLOW_ITEM.WRITE_OFF_ORDER"/>
        <bm:field name="calc_penalty" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CALC_PENALTY" prompt="HLS005.HLS_CASHFLOW_ITEM.CALC_PENALTY"/>
        <bm:field name="billing_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BILLING_DESC" prompt="HLS005.HLS_CASHFLOW_ITEM.BILLING_DESC"/>
        <bm:field name="ref_v01"/>
        <bm:field name="ref_v01_n" forInsert="false" forUpdate="false"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    t1.cf_item,
                    t1.cf_item_desc AS description,
                    t1.enabled_flag,
                    t1.cf_type,
                    t1.cf_type_desc,
                    t1.cf_direction,
                    t1.cf_direction_desc,
                    t1.reserved_flag,
                    t1.system_flag,
                    t1.write_off_order,
                    t1.calc_penalty,
                    t1.billing_desc,
                    t1.ref_v01,
                    (SELECT
                        v.code_value_name
                    FROM
                        sys_code_values_v v
                    WHERE
                        v.code       = 'NC_CF_ITEM' AND
                        v.code_value = t1.ref_v01
                    ) ref_v01_n
                FROM
                    hls_cashflow_item_v t1 #WHERE_CLAUSE#
                ORDER BY
                    t1.cf_type,
                    t1.cf_item
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="cf_item"/>
    </bm:primary-key>
    <e:exception-descriptor-config>
        <e:exception-descriptor exception="java.sql.SQLException" handleClass="leaf.database.SQLExceptionDescriptor">
            <e:error-message code="1" message="HLS005.HLS_CASHFLOW_ITEM.UNIQUE_INDEX_REPEATED"/>
        </e:exception-descriptor>
    </e:exception-descriptor-config>
</bm:model>
