<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="fcvl" baseTable="FND_COMPANIES_VL">
    <bm:fields>
        <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Double" physicalName="COMPANY_ID"/>
        <bm:field name="company_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMPANY_CODE" prompt="FND_COMPANIES.COMPANY_CODE"/>
        <bm:field name="company_icon" databaseType="BLOB" physicalName="COMPANY_ICON"/>
        <bm:field name="company_short_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMPANY_SHORT_NAME" prompt="FND_COMPANIES_VL.COMPANY_SHORT_NAME"/>
        <bm:field name="company_full_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMPANY_FULL_NAME"/>
        <bm:field name="company_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMPANY_TYPE"/>
        <bm:field name="set_of_books_id" databaseType="NUMBER" datatype="java.lang.Double" physicalName="SET_OF_BOOKS_ID" prompt="FND_COMPANIES.SET_OF_BOOKS_ID"/>
        <bm:field name="company_level_id" databaseType="NUMBER" datatype="java.lang.Double" physicalName="COMPANY_LEVEL_ID"/>
        <bm:field name="chief_position_id" databaseType="NUMBER" datatype="java.lang.Double" physicalName="CHIEF_POSITION_ID"/>
        <bm:field name="parent_company_id" databaseType="NUMBER" datatype="java.lang.Double" physicalName="PARENT_COMPANY_ID"/>
        <bm:field name="address" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ADDRESS"/>
        <bm:field name="start_date_active" databaseType="DATE" datatype="java.util.Date" physicalName="START_DATE_ACTIVE"/>
        <bm:field name="end_date_active" databaseType="DATE" datatype="java.util.Date" physicalName="END_DATE_ACTIVE"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:query-fields>
        <bm:query-field name="company_code_from" queryExpression="company_code &gt;= ${@company_code_from}"/>
        <bm:query-field name="company_code_to" queryExpression="company_code &lt;= ${@company_code_to}"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter name="filter" enforceOperations="query" expression="exists (select 1 from fnd_companies_vl fcvl2 where fcvl.set_of_books_id=fcvl2.set_of_books_id and fcvl2.company_id=${/session/@company_id})"/>
        <bm:data-filter name="start_date" enforceOperations="query" expression="fcvl.start_date_active &lt;sysdate"/>
        <bm:data-filter name="start_date" enforceOperations="query" expression="(fcvl.end_date_active is null or  fcvl.end_date_active  &gt;sysdate)"/>
    </bm:data-filters>
</bm:model>
