ibatis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbe...@apache.org
Subject svn commit: r677180 - /ibatis/trunk/java/mapper/mapper2/src/com/ibatis/sqlmap/engine/type/TypeHandlerFactory.java
Date Wed, 16 Jul 2008 07:29:40 GMT
Author: cbegin
Date: Wed Jul 16 00:29:39 2008
New Revision: 677180

URL: http://svn.apache.org/viewvc?rev=677180&view=rev
Log:
iBATIS 244  

Modified:
    ibatis/trunk/java/mapper/mapper2/src/com/ibatis/sqlmap/engine/type/TypeHandlerFactory.java

Modified: ibatis/trunk/java/mapper/mapper2/src/com/ibatis/sqlmap/engine/type/TypeHandlerFactory.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/src/com/ibatis/sqlmap/engine/type/TypeHandlerFactory.java?rev=677180&r1=677179&r2=677180&view=diff
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/src/com/ibatis/sqlmap/engine/type/TypeHandlerFactory.java
(original)
+++ ibatis/trunk/java/mapper/mapper2/src/com/ibatis/sqlmap/engine/type/TypeHandlerFactory.java
Wed Jul 16 00:29:39 2008
@@ -29,6 +29,16 @@
   private final TypeHandler unknownTypeHandler = new UnknownTypeHandler(this);
   private final HashMap typeAliases = new HashMap();
 
+  private static final Map reversePrimitiveMap = new HashMap() {{
+    put(Byte.class, byte.class);
+    put(Short.class, short.class);
+    put(Integer.class, int.class);
+    put(Long.class, long.class);
+    put(Float.class, float.class);
+    put(Double.class, double.class);
+    put(Boolean.class, boolean.class);
+  }};
+
 
   /* Constructor */
 
@@ -191,6 +201,10 @@
       typeHandlerMap.put(type, map);
     }
     map.put(jdbcType, handler);
+
+    if (reversePrimitiveMap.containsKey(type)) {
+      register((Class)reversePrimitiveMap.get(type),jdbcType,handler);
+    }
   }
 
   /**



Mime
View raw message