Skip to content

Commit

Permalink
fix: #793
Browse files Browse the repository at this point in the history
  • Loading branch information
yeeevip committed Jan 3, 2024
1 parent 6440439 commit f77704a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/java/com/github/pagehelper/page/PageAutoDialect.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,11 @@ public static String fromJdbcUrl(String jdbcUrl) {

//获取当前的代理对象
public AbstractHelperDialect getDelegate() {
if (delegate != null) {
if (autoDialect) {
return dialectThreadLocal.get();
} else {
return delegate;
}
return dialectThreadLocal.get();
}

//移除代理对象
Expand Down Expand Up @@ -229,11 +230,11 @@ public void initDelegateDialect(MappedStatement ms, String dialectClass) {
}
}
dialectThreadLocal.set(dialect);
} else if (delegate == null) {
} else {
if (autoDialect) {
this.delegate = autoGetDialect(ms);
} else {
dialectThreadLocal.set(autoGetDialect(ms));
} else if (delegate == null) {
delegate = autoGetDialect(ms);
}
}
}
Expand Down

0 comments on commit f77704a

Please sign in to comment.