mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 09:08:24 +08:00
fix: keyword in dm dialect
This commit is contained in:
parent
4af882af1a
commit
9f8e00ca9c
@ -20,6 +20,7 @@ import com.mybatisflex.core.util.StringUtil;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 用于对数据库的关键字包装
|
||||
@ -97,16 +98,15 @@ public class KeywordWrap {
|
||||
|
||||
public KeywordWrap(boolean caseSensitive, Set<String> keywords, String prefix, String suffix) {
|
||||
this.caseSensitive = caseSensitive;
|
||||
this.keywords = keywords;
|
||||
this.keywords = keywords.stream().map(String::toUpperCase).collect(Collectors.toSet());
|
||||
this.prefix = prefix;
|
||||
this.suffix = suffix;
|
||||
}
|
||||
|
||||
public KeywordWrap(boolean caseSensitive, boolean keywordsToUpperCase, Set<String> keywords, String prefix,
|
||||
String suffix) {
|
||||
public KeywordWrap(boolean caseSensitive, boolean keywordsToUpperCase, Set<String> keywords, String prefix, String suffix) {
|
||||
this.caseSensitive = caseSensitive;
|
||||
this.keywordsToUpperCase = keywordsToUpperCase;
|
||||
this.keywords = keywords;
|
||||
this.keywords = keywords.stream().map(String::toUpperCase).collect(Collectors.toSet());
|
||||
this.prefix = prefix;
|
||||
this.suffix = suffix;
|
||||
}
|
||||
@ -120,8 +120,12 @@ public class KeywordWrap {
|
||||
return prefix + keyword + suffix;
|
||||
}
|
||||
|
||||
keyword = keywordsToUpperCase ? keyword.toUpperCase() : keyword;
|
||||
return keywords.contains(keyword) ? (prefix + keyword + suffix) : keyword;
|
||||
if (keywordsToUpperCase) {
|
||||
keyword = keyword.toUpperCase();
|
||||
return keywords.contains(keyword) ? (prefix + keyword + suffix) : keyword;
|
||||
} else {
|
||||
return keywords.contains(keyword.toUpperCase()) ? (prefix + keyword + suffix) : keyword;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isCaseSensitive() {
|
||||
|
||||
@ -69,7 +69,6 @@ public class DmDialect extends CommonsDialectImpl {
|
||||
"SQL", "WHERE", "MIN", "PROCEDURE", "SQLCODE", "WHILE", "MINUS", "PUBLIC", "SQLERRM", "WITH", "MLSLABEL", "RAISE", "START",
|
||||
"WORK", "MOD", "RANGE", "STATEMENT", "XOR", "MODE", "REAL", "STDDEV", "NATURAL", "RECORD", "SUBTYPE", "GEN", "KP", "L",
|
||||
"NA", "NC", "ND", "NL", "NM", "NR", "NS", "NT", "NZ", "TTC", "UPI", "O", "S", "XA"
|
||||
|
||||
);
|
||||
|
||||
public DmDialect() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user