fnd_atm_attachment.lwm 3.34 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:ns2="leaf.database.local.oracle" xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="fa" baseTable="fnd_atm_attachment" needAccessControl="false">
    <bm:fields>
        <bm:field name="attachment_id" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="source_type_code" databaseType="VARCHAR" datatype="java.lang.String"/>
        <bm:field name="source_pk_value" databaseType="VARCHAR" datatype="java.lang.String"/>
        <bm:field name="file_name" databaseType="VARCHAR" datatype="java.lang.String"/>
        <bm:field name="file_size" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="file_path" databaseType="VARCHAR" datatype="java.lang.String"/>
        <bm:field name="status" databaseType="VARCHAR" datatype="java.lang.String" expression="&apos;1&apos;" forInsert="false" forUpdate="false"/>
        <bm:field name="creation_time" databaseType="TIMESTAMP" datatype="java.sql.Timestamp" forInsert="false" forQuery="true" forUpdate="false" physicalName="CREATION_DATE"/>
        <bm:field name="interface_flag" databaseType="VARCHAR" datatype="java.lang.String"/>
    </bm:fields>
    <bm:primary-key>
        <bm:pk-field name="attachment_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="attachment_id" queryOperator="="/>
    </bm:query-fields>
    <bm:relations>
        <bm:relation name="fam" joinType="LEFT OUTER" refModel="fnd.fnd_atm_attachment_multi">
            <bm:reference foreignField="attachment_id" localField="attachment_id"/>
        </bm:relation>
    </bm:relations>
    <bm:ref-fields>
        <bm:ref-field name="table_name" relationName="fam" sourceField="table_name"/>
        <bm:ref-field name="table_pk_value" relationName="fam" sourceField="table_pk_value"/>
    </bm:ref-fields>
    <bm:features>
        <ns2:sequence-pk/>
        <f:standard-who/>
    </bm:features>
    <bm:operations>
        <bm:operation name="delete">
            <bm:update-sql><![CDATA[
            begin
                delete from fnd_atm_attachment at where at.attachment_id = ${@attachment_id};
                delete from fnd_atm_attachment_multi atm where atm.attachment_id = ${@attachment_id};
            end;                
            ]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    *
                FROM
                    (SELECT
                        fa.attachment_id,
                        fa.source_type_code,
                        fa.source_pk_value,
                        fa.file_name,
                        fa.file_size,
                        fa.file_path,
                        '1' AS status,
                        fam.table_name,
                        fam.table_pk_value,
                        fa.creation_date AS creation_time,
                        fa.interface_flag
                    FROM
                        fnd_atm_attachment fa
                    LEFT OUTER JOIN fnd_atm_attachment_multi fam
                    ON
                        fa.attachment_id = fam.attachment_id
                    )fam #WHERE_CLAUSE#
                ORDER BY
                    file_name
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>