From: David Gageot Date: Tue, 10 Jul 2012 14:53:25 +0000 (+0200) Subject: Support null values without jdbctypes in MyBatis X-Git-Tag: 3.2~150 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e7467797855692324c6d8ebe014be49681e68c1d;p=sonarqube.git Support null values without jdbctypes in MyBatis --- diff --git a/pom.xml b/pom.xml index 243e8912258..3ead717e790 100644 --- a/pom.xml +++ b/pom.xml @@ -754,7 +754,7 @@ org.mybatis mybatis - 3.0.6 + 3.1.1 org.picocontainer diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java b/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java index 9fd5e305e66..0eb09205458 100644 --- a/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java +++ b/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java @@ -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());