<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:ns2="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="op" basetable="exp_org_position" defaultOrderBy="position_code">
    <bm:fields>
        <bm:field name="position_id" databasetype="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="unit_id" databasetype="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="position_code" databasetype="VARCHAR2" datatype="java.lang.String" displayWidth="200" fordisplay="true" forquery="true" prompt="EXP_ORG_POSITION.POSITION_CODE"/>
        <bm:field name="description_id" databasetype="NUMBER" datatype="java.lang.Long" multilanguage="true" multilanguagedescfield="position_name"/>
        <bm:field name="position_name" databasetype="VARCHAR" displayWidth="200" fordisplay="true" forinsert="false" forquery="true" forupdate="false" prompt="EXP_ORG_POSITION.POSITION_NAME"/>
        <bm:field name="parent_position_id" databasetype="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="company_id" databasetype="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="enabled_flag" databasetype="VARCHAR2" datatype="java.lang.String" prompt="HAP_ENABLED_FLAG"/>
        <bm:field name="employee_job_id" databasetype="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="position_type" databasetype="VARCHAR2" datatype="java.lang.String" displayWidth="200" fordisplay="true" forquery="true" lookupCode="HR_POSITION_TYPE" lookupField="position_type_display" physicalName="POSITION_TYPE" prompt="EXP_ORG_POSITION.POSITION_TYPE"/>
        <bm:field name="position_type_display" forInsert="fasle" forUpdate="false" prompt="EXP_ORG_POSITION.POSITION_TYPE"/>
        <bm:field name="parent_position_name_display" databasetype="VARCHAR2" datatype="java.lang.String" expression="(select parent.position_code || &apos;-&apos; || fd.description_text from fnd_descriptions fd,exp_org_position parent where parent.description_id = fd.description_id             and fd.language = ${/session/@lang} and op.parent_position_id = parent.position_id)" forinsert="false" forupdate="false" prompt="EXP_ORG_POSITION.PARENT_POSITION"/>
        <bm:field name="org_unit_description_display" databasetype="VARCHAR2" datatype="java.lang.String" expression="(select u.unit_code || &apos;-&apos; || fd.description_text from fnd_descriptions fd,exp_org_unit u where u.description_id = fd.description_id             and fd.language = ${/session/@lang} and u.unit_id = op.unit_id)" forinsert="false" forupdate="false" prompt="EXP_ORG_POSITION.UNIT"/>
        <bm:field name="employee_job_desc_display" databasetype="VARCHAR2" datatype="java.lang.String" expression="(select job.employee_job_code|| &apos;-&apos; || fd.description_text from fnd_descriptions fd,exp_employee_jobs job where job.description_id = fd.description_id             and fd.language = ${/session/@lang} and job.employee_job_id = op.employee_job_id)" forinsert="false" forupdate="false" prompt="EXP_ORG_POSITION.POSITION"/>
    </bm:fields>
    <bm:primary-key>
        <bm:pk-field name="position_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="position_code" queryoperator="like"/>
        <bm:query-field field="company_id" queryexpression="company_id = ${@company_id}"/>
        <bm:query-field field="position_name" queryexpression="exists (select 1 from fnd_descriptions fd where op.description_id=fd.description_id and fd.description_text like ${@position_name} and fd.language = ${/session/@lang})"/>
        <bm:query-field field="unit_id" queryexpression="unit_id = ${@unit_id}"/>
        <bm:query-field name="employee_id" queryexpression="exists (                                     select 1 from exp_employee_assigns eea                                      where eea.employee_id=${@employee_id}                                     and   eea.company_id = op.company_id                                     and   eea.position_id = op.position_id                                     and   eea.enabled_flag=&apos;Y&apos;)"/>
    </bm:query-fields>
    <bm:features>
        <ns2:sequence-pk/>
        <f:standard-who/>
        <f:multi-language-storage/>
    </bm:features>
    <bm:ref-fields/>
</bm:model>