<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:ns2="leaf.database.local.oracle" xmlns:f="leaf.database.features" extend="fnd.FND1060.fnd_calendar" extendMode="reference" baseTable="fnd_calendar" alias="fc">
    <bm:query-fields>
    </bm:query-fields>
    <bm:operations>
        <bm:operation name="update">
            <bm:parameters>
                <bm:parameter name="calendar_id" dataType="java.lang.String" required="true"/>
                <bm:parameter name="description" dataType="java.lang.String" required="true"/>
                <bm:parameter name="end_date" dataType="java.sql.Date" required="true"/>
                <bm:parameter name="start_date" dataType="java.sql.Date" required="true"/>
            </bm:parameters>
            <bm:update-sql>
                begin
                    fnd_calendar_pkg.update_calendar(
                        ${@calendar_id},
                        ${@description},
                        ${@start_date},
                        ${@end_date},
                        ${/session/@user_id}
                     );
                end;
            </bm:update-sql>
        </bm:operation>
        <bm:operation name="insert">
            <bm:parameters>
                <bm:parameter name="calendar_id"  dataType="java.lang.Long" output="true" inputPath="@calendar_id" outputPath="@calendar_id"/>
                <bm:parameter name="calendar_code" dataType="java.lang.String" required="true"/>
                <bm:parameter name="description" dataType="java.lang.String" required="true"/>
                <bm:parameter name="end_date" dataType="java.sql.Date" required="true" forInsert="true" forUpdate="true"/>
                <bm:parameter name="start_date" dataType="java.sql.Date" required="true" forInsert="true" forUpdate="true"/>
            </bm:parameters>
            <bm:update-sql>
                begin
                    fnd_calendar_pkg.insert_calendar(
                        ${@calendar_code},
                        ${@description},
                        ${@start_date},
                        ${@end_date},
                        ${/session/@user_id},
                        ${/session/@lang},
                        ${@calendar_id}
                     );
                end;
            </bm:update-sql>
        </bm:operation>
        <bm:operation name="delete">
            <bm:update-sql>
                begin
                    fnd_calendar_pkg.delete_calendar(p_calendar_id =>${@calendar_id},
                                                    p_user_id =>${/session/@user_id});         
                end;
            </bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:features>        
    </bm:features>
</bm:model>
