Commit abaa9ea87c79fc67e51f743345332b6ae03281c7

Authored by 王彬
1 parent 48cf30aa

fix a bug about dbname

@@ -51,7 +51,7 @@ uploadArchives { @@ -51,7 +51,7 @@ uploadArchives {
51 authentication(userName: NEXUS_USERNAME, password: NEXUS_PASSWORD) 51 authentication(userName: NEXUS_USERNAME, password: NEXUS_PASSWORD)
52 } 52 }
53 pom.project { 53 pom.project {
54 - version '2.0.3' 54 + version '2.0.4'
55 artifactId ARTIFACT_Id 55 artifactId ARTIFACT_Id
56 groupId GROUP_ID 56 groupId GROUP_ID
57 packaging TYPE 57 packaging TYPE
src/main/java/com/taover/repository/CustomJdbcTemplate.java
@@ -54,10 +54,12 @@ public class CustomJdbcTemplate<T, ID extends Serializable> { @@ -54,10 +54,12 @@ public class CustomJdbcTemplate<T, ID extends Serializable> {
54 throw new Exception("DAO层初始化失败,失败原因:"+tClassInfo.getName()+"实体类,没有@Table注解指定表名"); 54 throw new Exception("DAO层初始化失败,失败原因:"+tClassInfo.getName()+"实体类,没有@Table注解指定表名");
55 } 55 }
56 this.tableName = annoTable.name(); 56 this.tableName = annoTable.name();
57 - if(annoTable.schema() != null){  
58 - this.dbName = annoTable.schema();  
59 - }else if(annoTable.catalog() != null){  
60 - this.dbName = annoTable.catalog(); 57 + String schema = annoTable.schema();
  58 + String catalog = annoTable.catalog();
  59 + if(schema != null && !"".equals(schema)){
  60 + this.dbName = schema;
  61 + }else if(catalog != null && !"".equals(catalog)){
  62 + this.dbName = catalog;
61 } 63 }
62 64
63 //初始化数据 65 //初始化数据