<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:e="leaf.service.exception" xmlns:ns2="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="fnd_responsibility_centers">
    <bm:fields>
        <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="responsibility_center_id" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="responsibility_center_code" databaseType="VARCHAR2" datatype="java.lang.String" prompt="HLS.RESPONSIBILITY_CENTER_CODE"/>
        <bm:field name="responsibility_center_name_id" databaseType="NUMBER" datatype="java.lang.Long" multiLanguage="true" multiLanguageDescField="responsibility_center_name"/>
        <bm:field name="responsibility_center_name" databaseType="VARCHAR" datatype="java.lang.String" forInsert="false" forUpdate="false" prompt="HLS.RESPONSIBILITY_CENTER_NAME"/>
        <bm:field name="address_id" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="resp_center_type_code" databaseType="VARCHAR2" datatype="java.lang.String" lookupCode="RESP_CENTER_TYPE" lookupField="resp_center_type_name"/>
        <bm:field name="resp_center_type_name" databaseType="VARCHAR2" datatype="java.lang.String" forInsert="false" forUpdate="false" prompt="HLS.RESPONSIBILITY_CENTER_TYPE"/>
        <bm:field name="summary_flag" databaseType="VARCHAR2" datatype="java.lang.String" prompt="FND2110.FND_RESPONSIBILITY_CENTERS.SUMMARY_FLAG"/>
        <bm:field name="start_date_active" databaseType="DATE" datatype="java.util.Date" prompt="HLS.VALIDITY_FROM"/>
        <bm:field name="end_date_active" databaseType="DATE" datatype="java.util.Date" prompt="HLS.VALIDITY_TO"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
    			select t1.responsibility_center_id,
				       t1.company_id,
				       t1.responsibility_center_code,
				       t1.responsibility_center_name_id,
				       t1.responsibility_center_name,
				       t1.address_id,
				       t1.resp_center_type_code,
				       t1.resp_center_type_name,
				       t1.summary_flag,
				       t1.start_date_active,
				       t1.end_date_active
				  from fnd_responsibility_center_v t1
				  #WHERE_CLAUSE#
				  order by t1.responsibility_center_code
    		]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:primary-key>
        <bm:pk-field name="responsibility_center_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="responsibility_center_id" queryOperator="="/>
        <bm:query-field field="responsibility_center_code" queryOperator="like"/>
        <bm:query-field name="responsibility_center_name" queryExpression="like"/>
    </bm:query-fields>
    <bm:features>
        <ns2:sequence-pk/>
        <f:standard-who/>
        <f:multi-language-storage/>
    </bm:features>
    <bm:ref-fields/>
    <bm:data-filters>
        <bm:data-filter name="company_id" expression="company_id=${/session/@company_id}"/>
    </bm:data-filters>
    <e:exception-descriptor-config>
        <e:exception-descriptor exception="java.sql.SQLException" handleClass="leaf.database.SQLExceptionDescriptor">
            <e:error-message code="1" message="FND2110.ERROR.RESPONSIBILITY_CENTER_CODE_REPEATED"/>
        </e:exception-descriptor>
    </e:exception-descriptor-config>
</bm:model>
