mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-08-18 20:38:02 +08:00
fix sql formater bug
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
package cn.hutool.db.sql;
|
||||
|
||||
import java.util.*;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Set;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
/**
|
||||
* SQL格式化器 from Hibernate
|
||||
@@ -303,6 +308,9 @@ public class SqlFormatter {
|
||||
}
|
||||
|
||||
private static boolean isFunctionName(String tok) {
|
||||
if(StrUtil.isEmpty(tok)){
|
||||
return true;
|
||||
}
|
||||
char begin = tok.charAt(0);
|
||||
boolean isIdentifier = (Character.isJavaIdentifierStart(begin)) || ('"' == begin);
|
||||
return (isIdentifier) && (!LOGICAL.contains(tok)) && (!END_CLAUSES.contains(tok)) && (!QUANTIFIERS.contains(tok)) && (!DML.contains(tok)) && (!MISC.contains(tok));
|
||||
|
Reference in New Issue
Block a user