<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2013-4-15 下午12:39:21  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="HLS_BP_MASTER_RELATION">
    <bm:fields>
        <bm:field name="bp_relation_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_RELATION_ID" prompt="HLS_BP_MASTER_RELATION.BP_RELATION_ID"/>
        <bm:field name="bp_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID" prompt="HLS_BP_MASTER_RELATION.BP_ID"/>
        <bm:field name="relation_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="RELATION_TYPE" prompt="HLS_BP_MASTER_RELATION.RELATION_TYPE"/>
        <bm:field name="relation_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="RELATION_CATEGORY" prompt="HLS_BP_MASTER_RELATION.RELATION_CATEGORY"/>
        <bm:field name="related_bp_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="RELATED_BP_ID" prompt="HLS_BP_MASTER_RELATION.RELATED_BP_ID"/>
        <bm:field name="enabled_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLED_FLAG" prompt="HLS_BP_MASTER_RELATION.ENABLED_FLAG"/>
        <bm:field name="ref_v01" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V01" prompt="HLS_BP_MASTER_RELATION.REF_V01"/>
        <bm:field name="ref_v02" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V02" prompt="HLS_BP_MASTER_RELATION.REF_V02"/>
        <bm:field name="ref_v03" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V03" prompt="HLS_BP_MASTER_RELATION.REF_V03"/>
        <bm:field name="ref_v04" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V04" prompt="HLS_BP_MASTER_RELATION.REF_V04"/>
        <bm:field name="ref_v05" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V05" prompt="HLS_BP_MASTER_RELATION.REF_V05"/>
        <bm:field name="ref_n01" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N01" prompt="HLS_BP_MASTER_RELATION.REF_N01"/>
        <bm:field name="ref_n02" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N02" prompt="HLS_BP_MASTER_RELATION.REF_N02"/>
        <bm:field name="ref_n03" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N03" prompt="HLS_BP_MASTER_RELATION.REF_N03"/>
        <bm:field name="ref_n04" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N04" prompt="HLS_BP_MASTER_RELATION.REF_N04"/>
        <bm:field name="ref_n05" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N05" prompt="HLS_BP_MASTER_RELATION.REF_N05"/>
        <bm:field name="ref_d01" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D01" prompt="HLS_BP_MASTER_RELATION.REF_D01"/>
        <bm:field name="ref_d02" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D02" prompt="HLS_BP_MASTER_RELATION.REF_D02"/>
        <bm:field name="ref_d03" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D03" prompt="HLS_BP_MASTER_RELATION.REF_D03"/>
        <bm:field name="ref_d04" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D04" prompt="HLS_BP_MASTER_RELATION.REF_D04"/>
        <bm:field name="ref_d05" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D05" prompt="HLS_BP_MASTER_RELATION.REF_D05"/>
        <bm:field name="relation_type_desc" expression="(select l.description from hls_bp_relation_type l where l.relation_type=t1.relation_type)" forInsert="false" forUpdate="false"/>
        <bm:field name="related_bp" expression="(select d.bp_name from hls_bp_master d where d.bp_id=t1.related_bp_id)" forInsert="false" forUpdate="false"/>
        <bm:field name="relation_category_desc" expression="(select b.description from hls_bp_relation_category b where b.relation_category=t1.relation_category)" forInsert="false" forUpdate="false"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="bp_relation_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="bp_id" queryOperator="="/>
        <bm:query-field field="relation_type" queryOperator="="/>
    </bm:query-fields>
</bm:model>
