Insert

1. Process

  1. When adding an SQL ID, if you use insert* as the prefix, the statement type is automatically changed to insert.

    insert000
    Figure 1. Add insert SQL ID
  2. After clicking the [Basic SQL] button, search for the SMP_EMP_TST table and click the OK button; then the INSERT SQL is generated automatically.

    insert001
    Figure 2. Automatic generation of basic SQL
  3. Add the input type and save it. The DSmpEmpTst000Dto IO created when making the single-search service sample was reused.

  4. The output type is automatically set to int.

    insert002
    Figure 3. Insert DBIO

2. DBIO Sample

INSERT INTO SMP_EMP_TST /* Sample Employee Information TST */
(
     FEDU_EMP_NO /* FW Sample Employee Number */
    , FEDU_EMP_NM /* FW Sample Employee Name */
    , FEDU_OCCP_NM /* FW Sample Occupation Name */
    , FEDU_MNGR_EMP_NO /* FW Sample Manager Employee Number */
    , FEDU_IPSA_DT /* FW Sample Hire Date */
    , FEDU_PAY_AMT /* FW Sample Pay Amount */
    , FEDU_DEPT_NO /* FW Sample Department Number */
)
VALUES
(
    #{feduEmpNo} /* FW Sample Employee Number */
    , #{feduEmpNm} /* FW Sample Employee Name */
    , #{feduOccpNm} /* FW Sample Occupation Name */
    , #{feduMngrEmpNo} /* FW Sample Manager Employee Number */
    , #{feduIpsaDt} /* FW Sample Hire Date */
    , #{feduPayAmt} /* FW Sample Pay Amount */
    , #{feduDeptNo} /* FW Sample Department Number */
)

3. Bean Sample

@BxmCategory(logicalName = "Single Insert")
public int addEmpInf(DSmpEmpTst000Dto input) throws DefaultApplicationException {

    logger.debug("============== START ==============");
    logger.debug("input = {}", input);

    int addCnt = 0;
    dSmpEmpTst000 = DefaultApplicationContext.getBean(dSmpEmpTst000, DSmpEmpTst000.class);

    /**
     * @BXMType Try
     * @Desc Check duplicate employee id
     */
    try {
        /**
         * @BXMType DbioCall
         * @Desc insert a single employe info
         */
        addCnt = dSmpEmpTst000.insert00(input);

    } catch (DasDuplicateKeyException de) {
        /**
         * @BXMType ApplicationException
         * @Desc throw application exception if employee id is already exists
         */
        throw new DefaultApplicationException("BXME60007", new Object[] { input.getFeduEmpNo() } );
    }

    logger.debug("output = {}", addCnt);
    logger.debug("============== END ==============");

    return addCnt;
}
SWLab Bankware Global
  • 전체
  • BXM
  • BXCM
  • BXCP
  • BXI
제품 선택 시 더 정확한 매뉴얼 가이드를 제공해드립니다.

Copyright© Bankwareglobal All Rights Reserved.