]> source.dussan.org Git - sonarqube.git/commitdiff
Support null values without jdbctypes in MyBatis
authorDavid Gageot <david@gageot.net>
Tue, 10 Jul 2012 14:53:25 +0000 (16:53 +0200)
committerDavid Gageot <david@gageot.net>
Tue, 10 Jul 2012 14:53:31 +0000 (16:53 +0200)
pom.xml
sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java

diff --git a/pom.xml b/pom.xml
index 243e891225890ec41f4475da22f4f26869d4e9ff..3ead717e790736c3992f1081e9c6c687f3ce2f98 100644 (file)
--- a/pom.xml
+++ b/pom.xml
       <dependency>
         <groupId>org.mybatis</groupId>
         <artifactId>mybatis</artifactId>
-        <version>3.0.6</version>
+        <version>3.1.1</version>
       </dependency>
       <dependency>
         <groupId>org.picocontainer</groupId>
index 9fd5e305e66bfcfe7edbd8c93a439b26bf40a4ac..0eb092054588e1d62ad11b7ebc4c1447112f0f1b 100644 (file)
@@ -19,6 +19,8 @@
  */
 package org.sonar.core.persistence;
 
+import org.apache.ibatis.type.JdbcType;
+
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.ibatis.builder.xml.XMLMapperBuilder;
@@ -100,6 +102,7 @@ public class MyBatis implements BatchComponent, ServerComponent {
     conf.setEnvironment(new Environment("production", createTransactionFactory(), database.getDataSource()));
     conf.setUseGeneratedKeys(true);
     conf.setLazyLoadingEnabled(false);
+    conf.setJdbcTypeForNull(JdbcType.NULL);
     conf.getVariables().setProperty("_true", database.getDialect().getTrueSqlValue());
     conf.getVariables().setProperty("_false", database.getDialect().getFalseSqlValue());