This article gives an overview of how to make a joint between two tables, when the join clause includes a Select request on a third table which is not present in the mapping. 


Mapping overview :



The expression of the join clause would be :


        T_CUSTOMER.CUS_ID = T_ADDRESS.CUS_ID

        and T_CUSTOMER.CUS_ID IN (

        select TP.CUS_ID 

        from T_PHONE TP 

        where TP.pho_id=6)

The select request is done on the T_PHONE table, which is not present in the mapping.


If this expression is added to the joint as is, it will not be understood, since T_PHONE table is not known by the mapping.


Expression to use :


Here is the correct syntax to use in that context :


        

%x{md:objectPath(ref:schema('Schema Name'),'Table Name')}x%




HOTEL_MANAGEMENT is the Schema Name :


 

and T_PHONE is the table name




Caution: the expression will be valid only if the three tables are included in the same schema :