<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: chenlingfeng  
    $Date: 2017-10-24 上午9:50:15  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:o="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="HN_CALENDAR_RULES_REQ_LN" defaultOrderBy="year,month,day">
    <bm:fields>
        <bm:field name="calendar_rule_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CALENDAR_RULE_ID" prompt="HN_CALENDAR_RULES_REQ_LN.CALENDAR_RULE_ID"/>
        <bm:field name="request_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REQUEST_ID" prompt="HN_CALENDAR_RULES_REQ_LN.REQUEST_ID"/>
        <bm:field name="rule_type" databaseType="VARCHAR" datatype="java.lang.String" lookupCode="CALENDAR_RULE_TYPE" lookupField="rule_type_display"/>
        <bm:field name="rule_type_display" databaseType="VARCHAR" datatype="java.lang.String" forInsert="false" forUpdate="false" prompt="FND_CALENDAR_RULES.RULE_TYPE"/>
        <bm:field name="description_id" databaseType="NUMBER" datatype="java.lang.Long" multiLanguage="true" multiLanguageDescField="description"/>
        <bm:field name="description" databaseType="VARCHAR" datatype="java.lang.String" forInsert="false" forUpdate="false" prompt="FND_CALENDAR_RULES.DESCRIPTION"/>
        <bm:field name="year" databaseType="NUMBER" datatype="java.lang.Long" physicalName="YEAR" prompt="FND_CALENDAR_RULES.YEAR"/>
        <bm:field name="month" databaseType="NUMBER" datatype="java.lang.Long" physicalName="MONTH" prompt="FND_CALENDAR_RULES.MONTH"/>
        <bm:field name="day" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DAY" prompt="FND_CALENDAR_RULES.DAY"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk/>
        <f:multi-language-storage/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="calendar_rule_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="request_id" queryOperator="="/>
        <bm:query-field field="description" queryExpression="exists (select 1 from fnd_descriptions fd where fc.description_id=fd.description_id and fd.description_text like ${@description} and fd.language = ${/session/@lang})"/>
    </bm:query-fields>
</bm:model>
