IBATIS 요약

7452 단어 ibatis
다음 두 코드는 같은 값입니다.
단락 1
<insert id="addPaBonusInputItemInfo" parameterClass="linkMap">

        <![CDATA[

            INSERT INTO BN_PARAM_ITEM

                (

                    PARAM_ITEM_NO,

                    PARAM_ITEM_ID,

                    DATA_TYPE,

                    CREATE_DATE,

                  CREATED_BY,

                    ACTIVITY,

                    DESCR

                )

            VALUES(

                    #NO:VARCHAR#,

                    #ITEM_ID:VARCHAR#,

                    #DATA_TYPE:VARCHAR#,

                    SYSDATE,

                  #CREATED_BY:VARCAHR#,

                    1,

                    #DESCR:VARCHAR#

                )

        ]]>

    </insert>

  2 

<insert id="addPaBonusInputItemInfo" parameterClass="linkMap"> INSERT INTO BN_PARAM_ITEM <![CDATA[ ( ]]> <dynamic prepend=" "> <isNotEmpty prepend=",">PARAM_ITEM_NO</isNotEmpty> <isNotEmpty prepend=",">PARAM_ITEM_ID</isNotEmpty> <isNotEmpty prepend=",">DATA_TYPE</isNotEmpty> <isNotEmpty prepend=",">CREATE_DATE</isNotEmpty> <isNotEmpty property="CREATED_BY" prepend=",">CREATED_BY</isNotEmpty> <isNotEmpty prepend=",">ACTIVITY</isNotEmpty> <isNotEmpty prepend=",">DESCR</isNotEmpty> </dynamic> <![CDATA[ ) VALUES ( ]]> <dynamic prepend=" "> <isNotEmpty property="NO" prepend=",">#NO#</isNotEmpty> <isNotEmpty property="ITEM_ID" prepend=",">#ITEM_ID#</isNotEmpty> <isNotEmpty property="DATA_TYPE" prepend=",">#DATA_TYPE#</isNotEmpty> <![CDATA[ , SYSDATE, ]]> <isNotEmpty property="CREATED_BY" prepend=",">#CREATED_BY#</isNotEmpty> </dynamic> <![CDATA[ 1 ]]> <isNotEmpty property="DESCR" prepend=",">#DESCR#</isNotEmpty> <![CDATA[ ) ]]> </insert>

양자 차이
매개변수를 입력하면: CREATEDBY는 NULL입니다.
첫 번째 단락의 코드는 잘못 보고될 수 있다
두 번째 단락은 할 줄 모른다
 
SQL
INSERT INTO BN_PARAM_ITEM  (PARAM_ITEM_NO, PARAM_ITEM_ID, DATA_TYPE, CREATE_DATE, ACTIVITY, DESCR)VALUES  (?, ?, ?, SYSDATE, 1, ?)-- [124363, 2, NUMBER(14,4), 6]

좋은 웹페이지 즐겨찾기