From 7c4c94581a24c854a82187a7339f8eac5537af2a Mon Sep 17 00:00:00 2001 From: Yuriy Artamonov Date: Tue, 29 Jul 2014 07:54:58 +0000 Subject: [PATCH] Update MyBatis version #PL-3749 --- build.gradle | 4 ++-- .../core/sys/mybatis/UUIDTypeHandler.java | 20 +++++++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index b3f0433d76..e9915c30a2 100644 --- a/build.gradle +++ b/build.gradle @@ -222,8 +222,8 @@ configure(coreModule) { compile(group: 'org.jgroups', name: 'jgroups', version: '2.12.1.Final') compile(group: 'org.aspectj', name: 'aspectjrt', version: '1.6.12') compile(group: 'org.aspectj', name: 'aspectjweaver', version: '1.6.12') - compile(group: 'org.mybatis', name: 'mybatis', version: '3.0.5') - compile(group: 'org.mybatis', name: 'mybatis-spring', version: '1.0.1') + compile(group: 'org.mybatis', name: 'mybatis', version: '3.2.7') + compile(group: 'org.mybatis', name: 'mybatis-spring', version: '1.2.2') compile(group: 'org.springframework', name: 'spring-context-support', version: springVersion) compile(group: 'org.springframework', name: 'spring-orm', version: springVersion) compile(group: 'org.springframework', name: 'spring-tx', version: springVersion) diff --git a/modules/core/src/com/haulmont/cuba/core/sys/mybatis/UUIDTypeHandler.java b/modules/core/src/com/haulmont/cuba/core/sys/mybatis/UUIDTypeHandler.java index 1fb5e26937..0f1319f566 100644 --- a/modules/core/src/com/haulmont/cuba/core/sys/mybatis/UUIDTypeHandler.java +++ b/modules/core/src/com/haulmont/cuba/core/sys/mybatis/UUIDTypeHandler.java @@ -25,18 +25,30 @@ public class UUIDTypeHandler implements TypeHandler { @Override public Object getResult(ResultSet rs, String columnName) throws SQLException { String val = rs.getString(columnName); - if (val != null) + if (val != null) { return UuidProvider.fromString(val); - else + } else { return null; + } + } + + @Override + public Object getResult(ResultSet rs, int columnIndex) throws SQLException { + String val = rs.getString(columnIndex); + if (val != null) { + return UuidProvider.fromString(val); + } else { + return null; + } } @Override public Object getResult(CallableStatement cs, int columnIndex) throws SQLException { String val = cs.getString(columnIndex); - if (val != null) + if (val != null) { return UuidProvider.fromString(val); - else + } else { return null; + } } } \ No newline at end of file