This commit is contained in:
Looly
2023-04-12 01:22:54 +08:00
parent d2e5155ac5
commit a96a95c988
216 changed files with 480 additions and 480 deletions

View File

@@ -980,7 +980,7 @@ public abstract class AbstractDb<R extends AbstractDb<R>> extends DefaultConnect
throw new DbRuntimeException(e);
}
}
if (! isSupportTransaction) {
if (!isSupportTransaction) {
throw new DbRuntimeException("Transaction not supported for current database!");
}
}

View File

@@ -326,7 +326,7 @@ public class DaoTemplate {
*/
public List<Entity> findBySql(String sql, final Object... params) throws DbRuntimeException {
final String selectKeyword = StrUtil.subPre(sql.trim(), 6).toLowerCase();
if (! "select".equals(selectKeyword)) {
if (!"select".equals(selectKeyword)) {
sql = "SELECT * FROM " + this.tableName + " " + sql;
}
return db.query(sql, params);

View File

@@ -46,7 +46,7 @@ public class DefaultConnectionHolder implements ConnectionHolder {
@Override
public void closeConnection(final Connection conn) {
try {
if (conn != null && ! conn.getAutoCommit()) {
if (conn != null && !conn.getAutoCommit()) {
// 事务中的Session忽略关闭事件
return;
}

View File

@@ -106,7 +106,7 @@ public enum ThreadLocalConnection {
final Connection conn = connMap.get(ds);
if (null != conn) {
try {
if (! conn.getAutoCommit()) {
if (!conn.getAutoCommit()) {
// 非自动提交事务的连接,不做关闭(可能处于事务中)
return this;
}

View File

@@ -34,7 +34,7 @@ public class SqlServer2012Dialect extends AnsiSqlDialect {
@Override
protected SqlBuilder wrapPageSql(final SqlBuilder find, final Page page) {
if (! StrUtil.containsIgnoreCase(find.toString(), "order by")) {
if (!StrUtil.containsIgnoreCase(find.toString(), "order by")) {
//offset 分页必须要跟在order by后面没有情况下补充默认排序
find.append(" order by current_timestamp");
}

View File

@@ -359,7 +359,7 @@ public class Condition implements Cloneable, Serializable {
// 类似:" (?,?,?)" 或者 " (1,2,3,4)"
buildValuePartForIN(conditionStrBuilder, paramValues);
} else {
if (isPlaceHolder() && ! isOperatorIs()) {
if (isPlaceHolder() && !isOperatorIs()) {
// 使用条件表达式占位符,条件表达式并不适用于 IS NULL
conditionStrBuilder.append(" ?");
if (null != paramValues) {
@@ -473,7 +473,7 @@ public class Condition implements Cloneable, Serializable {
}
// 其他类型值,跳过
if (! (this.value instanceof String)) {
if (!(this.value instanceof String)) {
return;
}
@@ -575,7 +575,7 @@ public class Condition implements Cloneable, Serializable {
* @return 转换后的值
*/
private static Object tryToNumber(final String value) {
if (! NumberUtil.isNumber(value)) {
if (!NumberUtil.isNumber(value)) {
return value;
}
try {

View File

@@ -54,7 +54,7 @@ public enum Direction {
return Direction.valueOf(value.toUpperCase());
} catch (final Exception e) {
throw new IllegalArgumentException(StrUtil.format(
"Invalid value [{}] for orders given! Has to be either 'desc' or 'asc' (case insensitive).", value), e);
"Invalid value [{}] for orders given!Has to be either 'desc' or 'asc' (case insensitive).", value), e);
}
}
}

View File

@@ -155,7 +155,7 @@ public class SqlFormatter {
misc();
}
if (! isWhitespace(this.token)) {
if (!isWhitespace(this.token)) {
this.lastToken = this.lcToken;
}
}