Uploaded image for project: 'iBatis for Java [READ ONLY]'
  1. iBatis for Java [READ ONLY]
  2. IBATIS-433

ResultSetLogProxy doesn't log null value incorrectly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.2.0
    • 2.3.1
    • Core
    • None
    • Windows XP
      Oracle 10.2.0.2

    Description

      ResultSetLogProxy logs null values incorrectly when it transfers to Java primitive wrapper objects.

      Bean class to transfer is defined...
      class Item

      { private String itemCd; private String itemNm; private String supplierCd; private Integer itemDivision; // getters and setters difinition below. : } Difinition of Item table is... ITEM_CD NOT NULL VARCHAR2(10) ITEM_NM VARCHAR2(60) SUPPLIER_CD VARCHAR2(10) ITEM_DIVISION NUMBER(1) When I got an item from Oracle such as [item001, SumpleItem001, null, null] transfered bean object contains correct values. itemCd = "item001" itemNm = "SumpleItem001" supplierCd = null itemDivision = null But ResultSetLogProxy logs ResultSet values such as following. -------------------------------------------------- {rset-100012}

      Header: [ITEMCD, ITEMNM, SUPPLIERCD, ITEMDIVISION]

      {rset-100012}

      Result: [item001, SumpleItem001, null, 0]
      --------------------------------------------------

      In IntegerTypeHandler.java getResult() statement
      --------------------------------------------------
      int i = rs.getInt(columnName); // --(A)
      if (rs.wasNull())

      { return null; // --(B) }

      else

      { return new Integer(i); // --(B) }

      --------------------------------------------------
      (A) is output for logging.
      (B) is used for bean mappings.

      Attachments

        Activity

          People

            Unassigned Unassigned
            shiro-12 Kenichi Yamaoka
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: