<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" baseTable="fnd_coding_rule_details">
    <bm:fields>
        <bm:field name="coding_rule_line_id" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="coding_rule_id" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="sequence" databaseType="NUMBER" datatype="java.lang.Long" prompt="FND1910.FND_CODING_RULE_DETAILS.SEQUENCE"/>
        <bm:field name="segment_type" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="segment_type_name" forInsert="true" forUpdate="true" prompt="FND1910.FND_CODING_RULE_DETAILS.SEGMENT_TYPE"/>
        <bm:field name="segment_value" databaseType="VARCHAR2" datatype="java.lang.String" prompt="FND1910.FND_CODING_RULE_DETAILS.SEGMENT_VALUE"/>
        <bm:field name="length" databaseType="NUMBER" datatype="java.lang.Long" prompt="FND1910.FND_CODING_RULE_DETAILS.LENGTH"/>
        <bm:field name="incremental" databaseType="NUMBER" datatype="java.lang.Long" prompt="FND1910.FND_CODING_RULE_DETAILS.INCREMENTAL"/>
        <bm:field name="start_value" databaseType="NUMBER" datatype="java.lang.Long" prompt="FND1910.FND_CODING_RULE_DETAILS.START_VALUE"/>
        <bm:field name="date_format" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="date_format_name" forInsert="true" forUpdate="true" prompt="FND1910.FND_CODING_RULE_DETAILS.DATE_FORMAT"/>
        <bm:field name="display_flag" databaseType="VARCHAR2" datatype="java.lang.String" prompt="FND1910.FND_CODING_RULE_DETAILS.DISPLAY_FLAG"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
    			select t1.coding_rule_line_id,
				       t1.coding_rule_id,
				       t1.sequence,
				       t1.segment_type,
				       t1.segment_type_name,
				       t1.segment_value,
				       t1.date_format,
				       t1.date_format_name,
				       t1.length,
				       t1.incremental,
				       t1.start_value,
				       t1.display_flag
				  from fnd_coding_rule_detail_v t1
				  #WHERE_CLAUSE#
    		]]></bm:query-sql>
        </bm:operation>
        <bm:operation name="insert">
            <bm:parameters>
                <bm:parameter name="coding_rule_id" dataType="java.lang.Long" required="true"/>
                <bm:parameter name="sequence" dataType="java.lang.Long" required="true"/>
                <bm:parameter name="segment_type" dataType="java.lang.String" required="true"/>
                <bm:parameter name="length" dataType="java.lang.Long"/>
                <bm:parameter name="incremental" dataType="java.lang.Long"/>
                <bm:parameter name="start_value" dataType="java.lang.Long"/>
            </bm:parameters>
            <bm:update-sql><![CDATA[
                 begin
                      fnd_code_rule_pkg.insert_fnd_coding_rule_details(${@coding_rule_id},
                                                                     ${@sequence},                                          
                                                                     ${@segment_type},
                                                                     ${@segment_value},                                                     
                                                                     ${@length},    
                                                                     ${@incremental},       
                                                                     ${@start_value},                                       
                                                                     ${/session/@user_id},
                                                                     ${@date_format},
                                                                     ${@display_flag}                                                
                                                                     );
                 end;
            ]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="update">
            <bm:parameters>
                <bm:parameter name="coding_rule_line_id" dataType="java.lang.Long" required="true"/>
                <bm:parameter name="coding_rule_id" dataType="java.lang.Long" required="true"/>
                <bm:parameter name="sequence" dataType="java.lang.Long" required="true"/>
                <bm:parameter name="segment_type" dataType="java.lang.String" required="true"/>
                <bm:parameter name="length" dataType="java.lang.Long"/>
                <bm:parameter name="incremental" dataType="java.lang.Long"/>
                <bm:parameter name="start_value" dataType="java.lang.Long"/>
            </bm:parameters>
            <bm:update-sql><![CDATA[
                 begin
                      fnd_code_rule_pkg.update_fnd_coding_rule_details(${@coding_rule_line_id},
                                                                     ${@coding_rule_id},    
                                                                     ${@sequence},                                      
                                                                     ${@segment_type},
                                                                     ${@segment_value},                                                     
                                                                     ${@length},    
                                                                     ${@incremental},       
                                                                     ${@start_value},                                       
                                                                     ${/session/@user_id},                                                                  
                                                                     ${@date_format},
                                                                     ${@display_flag}                                    
                                                                     );
                 end;
            ]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="delete">
            <bm:parameters>
                <bm:parameter name="coding_rule_line_id" dataType="java.lang.Long" required="true"/>
                <bm:parameter name="coding_rule_id" dataType="java.lang.Long" required="true"/>
            </bm:parameters>
            <bm:update-sql><![CDATA[
                 begin
                      fnd_code_rule_pkg.delete_fnd_coding_rule_details(${@coding_rule_line_id},
                                                                     ${@coding_rule_id},                                                                                            
                                                                     ${/session/@user_id}                                                
                                                                     );
                 end;
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:primary-key>
        <bm:pk-field name="coding_rule_line_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="coding_rule_id" queryExpression="coding_rule_id=${/parameter/@coding_rule_id}"/>
    </bm:query-fields>
    <bm:ref-fields/>
</bm:model>
