<?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" baseTable="fnd_atm_attachment_multi" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
            select
            count(1) AS counts
            from FND_ATM_ATTACHMENT_MULTI t1
            #WHERE_CLAUSE#
        ]]></bm:query-sql>
        </bm:operation>
        <bm:operation name="delete">
            declare
            v_attachment_id number;
            begin
                select attachment_id into v_attachment_id from fnd_atm_attachment_multi m where m.record_id = ${@record_id};

                delete fnd_atm_attachment_multi m where m.record_id = ${@record_id};

                delete fnd_atm_attachment f where f.attachment_id = v_attachment_id;
            end;
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="counts" datatype="java.lang.Long" databaseType="NUMBER"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>

</bm:model>
