<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:e="leaf.service.exception" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="fc" baseTable="gld_period_sets" defaultorderby="period_set_code">
    <bm:fields>
        <bm:field name="period_set_code" databaseType="VARCHAR" datatype="java.lang.String" prompt="GLD_PERIOD_SET.PERIOD_SET_CODE"/>
        <bm:field name="period_set_name" databaseType="VARCHAR" datatype="java.lang.String" prompt="GLD_PERIOD_SET.PERIOD_SET_NAME"/>
        <bm:field name="total_period_num" databaseType="BIGINT" datatype="java.lang.Long" prompt="GLD_PERIOD_SET.TOTAL_PERIOD_NUM"/>
        <bm:field name="period_additional_flag" databaseType="VARCHAR" datatype="java.lang.String" lookupCode="PERIOD_ADDITIONAL_FLAG" lookupField="period_additional_flag_desc"/>
        <bm:field name="period_additional_flag_desc" databaseType="VARCHAR" datatype="java.lang.String" forInsert="false" forUpdate="false" prompt="GLD_PERIOD_SET.PERIOD_ADDITIONAL_FLAG"/>
        <bm:field name="rule_count" dataType="java.lang.Long" databaseType="NUMBER" expression="(nvl((select count(*) from gld_period_rules gpr where gpr.period_set_code = fc.period_set_code group by gpr.period_set_code), 0))" forInsert="false" forUpdate="false"/>
        <bm:field name="period_code_name" databaseType="VARCHAR" datatype="java.lang.String" expression="(fc.period_set_code||&apos;-&apos;|| fc.period_set_name )" forInsert="false" forUpdate="false" prompt="GLD_PERIOD_SET.PERIOD_ADDITIONAL_FLAG"/>
    </bm:fields>
    <bm:primary-key>
        <bm:pk-field name="period_set_code"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="period_set_code" queryOperator="like"/>
        <bm:query-field field="period_set_name" queryOperator="like"/>
    </bm:query-fields>
    <bm:features>
        <f:standard-who/>
        <f:multi-language-storage/>
    </bm:features>
    <bm:ref-fields/>
    <e:exception-descriptor-config>
        <e:exception-descriptor exception="java.sql.SQLException" handleClass="leaf.database.SQLExceptionDescriptor">
            <e:error-message code="1" message="GLD_PERIOD_SET.PERIOD_SET_CODE_DISTINCT"/>
        </e:exception-descriptor>
    </e:exception-descriptor-config>
</bm:model>