<?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="gr" baseTable="exp_position_group_relations">
    <bm:fields>
        <bm:field name="position_id" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="position_group_id" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="company_short_name" expression="(select b.company_short_name from fnd_companies_vl b where pos.company_id = b.company_id)" forDisplay="true" forInsert="false" forquery="true"/>
    </bm:fields>
    <bm:primary-key>
        <bm:pk-field name="position_id"/>
        <bm:pk-field name="position_group_id"/>
    </bm:primary-key>
    <bm:relations>
        <bm:relation name="pos" joinType="inner" refModel="exp.exp_org_position">
            <bm:reference foreignField="position_id" localField="position_id"/>
        </bm:relation>
    </bm:relations>
    <bm:query-fields>
        <bm:query-field field="position_group_id" queryExpression="position_group_id = ${@position_group_id}"/>
    </bm:query-fields>
    <bm:features>
        <f:standard-who/>
        <f:multi-language-display/>
    </bm:features>
    <bm:ref-fields>
        <bm:ref-field name="company_id" relationName="pos" sourceField="company_id"/>
        <bm:ref-field name="position_code" prompt="EXP_ORG_POSITION.POSITION_CODE" relationName="pos" sourceField="position_code"/>
        <bm:ref-field name="description_id" relationName="pos" sourceField="description_id"/>
    </bm:ref-fields>
    <e:exception-descriptor-config>
        <e:exception-descriptor exception="java.sql.SQLException" handleClass="leaf.database.SQLExceptionDescriptor">
            <e:error-message code="1" message="BGT_JOURNAL_INTERFACE.POSITION_CODE_DISTINCT"/>
        </e:exception-descriptor>
    </e:exception-descriptor-config>
</bm:model>
