<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" baseTable="prj_project_bp">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[select d.project_id,
             d.bp_category,
             (select c.description
                from hls_bp_category c
               where c.bp_category = d.bp_category) bp_category_desc,
             d.prj_bp_id,
             h.bp_id,
             h.bp_code,
             h.bp_name,
             h.bp_type,
             h.bp_type_desc,   
                h.bp_class,
                   h.bp_class_desc
        from prj_project_bp d, hls_bp_master_all_data_v h
        #WHERE_CLAUSE#
        order by h.bp_code]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="project_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PROJECT_ID"/>
        <bm:field name="bp_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_CATEGORY"/>
        <bm:field name="bp_category_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_CATEGORY_DESC"/>
        <bm:field name="prj_bp_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PRJ_BP_ID"/>
        <bm:field name="bp_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID"/>
        <bm:field name="bp_code" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="210" forDisplay="true" forQuery="true" physicalName="BP_CODE" prompt="HLS.BP_CODE"/>
        <bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="210" forDisplay="true" forQuery="true" physicalName="BP_NAME" prompt="HLS.BP_NAME"/>
        <bm:field name="bp_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_TYPE"/>
        <bm:field name="bp_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_TYPE_DESC"/>
        <bm:field name="bp_class" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_CLASS"/>
        <bm:field name="bp_class_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_CLASS_DESC"/>
    </bm:fields>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="d.bp_id = h.bp_id"/>
    </bm:data-filters>
    <bm:query-fields>
        <bm:query-field field="project_id" queryOperator="="/>
    </bm:query-fields>
</bm:model>
