From 35e87a657979f0c3ba6a5a108dcb1866000a2aa6 Mon Sep 17 00:00:00 2001 From: 王彬 Date: Fri, 6 Sep 2019 11:31:36 +0800 Subject: [PATCH] 1.fix a bug about getTableSql --- build.gradle | 2 +- src/main/java/com/taover/repository/CustomJdbcTemplate.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index dffe06e..b106ce8 100644 --- a/build.gradle +++ b/build.gradle @@ -51,7 +51,7 @@ uploadArchives { authentication(userName: NEXUS_USERNAME, password: NEXUS_PASSWORD) } pom.project { - version '2.1.0' + version '2.1.1' artifactId ARTIFACT_Id groupId GROUP_ID packaging TYPE diff --git a/src/main/java/com/taover/repository/CustomJdbcTemplate.java b/src/main/java/com/taover/repository/CustomJdbcTemplate.java index 0c80d20..a470420 100644 --- a/src/main/java/com/taover/repository/CustomJdbcTemplate.java +++ b/src/main/java/com/taover/repository/CustomJdbcTemplate.java @@ -227,7 +227,9 @@ public class CustomJdbcTemplate { } private String getTableSql(){ - return "".equals(this.dbName)?"`"+this.tableName+"`":("`"+this.dbName+"`.`"+this.tableName+"`"); + return (this.dbName == null || "".equals(this.dbName.trim()))? + ("`"+this.tableName+"`"): + ("`"+this.dbName+"`.`"+this.tableName+"`"); } /** -- libgit2 0.21.2