<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: xiaobo  
    $Date: 2012-11-27 下午3:08:27  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[select a.code_value, b.description_text as code_value_name
  from sys_code_values a, fnd_descriptions b, sys_codes c
   #WHERE_CLAUSE#
   order by a.code_value_id
   ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="code_value" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CODE_VALUE" required="true"/>
        <bm:field name="code_value_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CODE_VALUE_NAME"/>
    </bm:fields>
    <bm:data-filters>
        <bm:data-filter name="code_value_name_id" enforceOperations="query" expression="a.code_value_name_id = b.description_id(+)"/>
        <bm:data-filter name="code_id" enforceOperations="query" expression="a.code_id = c.code_id"/>
        <bm:data-filter name="language" enforceOperations="query" expression="b.language(+) = USERENV(&apos;LANG&apos;)"/>
        <bm:data-filter name="ref_table" enforceOperations="query" expression="b.ref_table(+) = &apos;SYS_CODE_VALUES&apos;"/>
        <bm:data-filter name="ref_field" enforceOperations="query" expression="b.ref_field(+) = &apos;CODE_VALUE_NAME_ID&apos;"/>
        <bm:data-filter name="enabled_flag" enforceOperations="query" expression="a.enabled_flag = &apos;Y&apos;"/>
    </bm:data-filters>
    <bm:query-fields>
        <bm:query-field name="code" queryExpression="c.code = ${/parameter/@code}"/>
    </bm:query-fields>
</bm:model>
