Ibatis 3 and null values

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Ibatis 3 and null values

Laurent MANNS
Hello,

I'm facing a weird problem when resultType is a Map :


<select id="test" resultType="java.util.LinkedHashMap">
  select
    getDate() "Timestamp",
    null      "Test"
</select>


List<LinkedHashMap<Object, Object>> lignes = session.selectList("test");
               
for (Iterator it = ((LinkedHashMap<Object, Object>)    
lignes.get(0)).keySet().iterator(); it.hasNext();)
                  System.out.println(it.next());
               
                 
The result is :

   TIMESTAMP
   Timestamp
   1

Why is first column duplicated when the alias is in lowercase ? And why can't i
get the second column header when it contains null values ?

Any help would be appreciated.

Thx.




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Ibatis 3 and null values

Poitras Christian
Ibatis project moved to Google. If I am not mistaking, the developers of iBATIS are not registered to this list anymore.
Please, post your questions to the new list at [hidden email]

Christian

-----Original Message-----
From: Laurent MANNS [mailto:[hidden email]]
Sent: Monday, July 05, 2010 4:58 AM
To: [hidden email]
Subject: Ibatis 3 and null values

Hello,

I'm facing a weird problem when resultType is a Map :


<select id="test" resultType="java.util.LinkedHashMap">
  select
    getDate() "Timestamp",
    null      "Test"
</select>


List<LinkedHashMap<Object, Object>> lignes = session.selectList("test");
               
for (Iterator it = ((LinkedHashMap<Object, Object>)    
lignes.get(0)).keySet().iterator(); it.hasNext();)
                  System.out.println(it.next());
               
                 
The result is :

   TIMESTAMP
   Timestamp
   1

Why is first column duplicated when the alias is in lowercase ? And why can't i get the second column header when it contains null values ?

Any help would be appreciated.

Thx.




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...