You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Kenichi Yamaoka (JIRA)" <ib...@incubator.apache.org> on 2007/05/30 05:05:19 UTC

[jira] Created: (IBATIS-433) ResultSetLogProxy doesn't log null value incorrectly

ResultSetLogProxy doesn't log null value incorrectly
----------------------------------------------------

                 Key: IBATIS-433
                 URL: https://issues.apache.org/jira/browse/IBATIS-433
             Project: iBatis for Java
          Issue Type: Bug
          Components: SQL Maps
    Affects Versions: 2.2.0
         Environment: Windows XP
Oracle 10.2.0.2

            Reporter: Kenichi Yamaoka
            Priority: Minor


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.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (IBATIS-433) ResultSetLogProxy doesn't log null value incorrectly

Posted by "Clinton Begin (JIRA)" <ib...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/IBATIS-433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Clinton Begin closed IBATIS-433.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.3.1

> ResultSetLogProxy doesn't log null value incorrectly
> ----------------------------------------------------
>
>                 Key: IBATIS-433
>                 URL: https://issues.apache.org/jira/browse/IBATIS-433
>             Project: iBatis for Java
>          Issue Type: Bug
>          Components: SQL Maps
>    Affects Versions: 2.2.0
>         Environment: Windows XP
> Oracle 10.2.0.2
>            Reporter: Kenichi Yamaoka
>            Priority: Minor
>             Fix For: 2.3.1
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.