mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-06 16:48:24 +08:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
d6832e4f8d
@ -66,7 +66,7 @@ QueryWrapper qw = QueryWrapper.create()
|
||||
.where(Account::getAge).eq(18)
|
||||
.and(Account::getId).ge(0);
|
||||
|
||||
Page<Account> accountPage = ccountMapper
|
||||
Page<Account> accountPage = accountMapper
|
||||
.xmlPaginate("selectByName", Page.of(1, 10), qw);
|
||||
```
|
||||
|
||||
@ -123,7 +123,7 @@ QueryWrapper qw = QueryWrapper.create()
|
||||
Map<String,Object> otherParams = new HashMap<>();
|
||||
otherParams.put("otherName", "michael");
|
||||
|
||||
Page<Account> accountPage = ccountMapper
|
||||
Page<Account> accountPage = accountMapper
|
||||
.xmlPaginate("selectByName", Page.of(1, 10), qw, otherParams);
|
||||
```
|
||||
|
||||
|
||||
@ -124,7 +124,7 @@ public class JavadocConfig implements Serializable {
|
||||
}
|
||||
|
||||
public String formatTableComment(String comment) {
|
||||
if (StringUtil.isBlank(comment)) {
|
||||
if (StringUtil.noText(comment)) {
|
||||
return "";
|
||||
}
|
||||
return tableCommentFormat.apply(comment);
|
||||
@ -146,7 +146,7 @@ public class JavadocConfig implements Serializable {
|
||||
}
|
||||
|
||||
public String formatColumnComment(String comment) {
|
||||
if (StringUtil.isBlank(comment)) {
|
||||
if (StringUtil.noText(comment)) {
|
||||
return "";
|
||||
}
|
||||
return columnCommentFormat.apply(comment);
|
||||
|
||||
@ -78,7 +78,7 @@ public class PackageConfig implements Serializable {
|
||||
* 获取生成目录。
|
||||
*/
|
||||
public String getSourceDir() {
|
||||
if (StringUtil.isBlank(sourceDir)) {
|
||||
if (StringUtil.noText(sourceDir)) {
|
||||
return System.getProperty("user.dir") + "/src/main/java";
|
||||
}
|
||||
return sourceDir;
|
||||
@ -111,7 +111,7 @@ public class PackageConfig implements Serializable {
|
||||
* 获取实体类层包路径。
|
||||
*/
|
||||
public String getEntityPackage() {
|
||||
if (StringUtil.isBlank(entityPackage)) {
|
||||
if (StringUtil.noText(entityPackage)) {
|
||||
return basePackage.concat(".entity");
|
||||
}
|
||||
return entityPackage;
|
||||
@ -129,7 +129,7 @@ public class PackageConfig implements Serializable {
|
||||
* 获取映射层包路径。
|
||||
*/
|
||||
public String getMapperPackage() {
|
||||
if (StringUtil.isBlank(mapperPackage)) {
|
||||
if (StringUtil.noText(mapperPackage)) {
|
||||
return basePackage.concat(".mapper");
|
||||
}
|
||||
return mapperPackage;
|
||||
@ -147,7 +147,7 @@ public class PackageConfig implements Serializable {
|
||||
* 获取服务层包路径。
|
||||
*/
|
||||
public String getServicePackage() {
|
||||
if (StringUtil.isBlank(servicePackage)) {
|
||||
if (StringUtil.noText(servicePackage)) {
|
||||
return basePackage.concat(".service");
|
||||
}
|
||||
return servicePackage;
|
||||
@ -165,7 +165,7 @@ public class PackageConfig implements Serializable {
|
||||
* 获取服务层实现包路径。
|
||||
*/
|
||||
public String getServiceImplPackage() {
|
||||
if (StringUtil.isBlank(serviceImplPackage)) {
|
||||
if (StringUtil.noText(serviceImplPackage)) {
|
||||
return basePackage.concat(".service.impl");
|
||||
}
|
||||
return serviceImplPackage;
|
||||
@ -183,7 +183,7 @@ public class PackageConfig implements Serializable {
|
||||
* 获取控制层包路径。
|
||||
*/
|
||||
public String getControllerPackage() {
|
||||
if (StringUtil.isBlank(controllerPackage)) {
|
||||
if (StringUtil.noText(controllerPackage)) {
|
||||
return basePackage.concat(".controller");
|
||||
}
|
||||
return controllerPackage;
|
||||
@ -201,7 +201,7 @@ public class PackageConfig implements Serializable {
|
||||
* 获取表定义层包路径。
|
||||
*/
|
||||
public String getTableDefPackage() {
|
||||
if (StringUtil.isBlank(tableDefPackage)) {
|
||||
if (StringUtil.noText(tableDefPackage)) {
|
||||
return getEntityPackage().concat(".table");
|
||||
}
|
||||
return tableDefPackage;
|
||||
@ -219,7 +219,7 @@ public class PackageConfig implements Serializable {
|
||||
* 获取 Mapper XML 文件路径。
|
||||
*/
|
||||
public String getMapperXmlPath() {
|
||||
if (StringUtil.isBlank(mapperXmlPath)) {
|
||||
if (StringUtil.noText(mapperXmlPath)) {
|
||||
return System.getProperty("user.dir").concat("/src/main/resources/mapper");
|
||||
}
|
||||
return mapperXmlPath;
|
||||
|
||||
@ -73,12 +73,12 @@ public class JdbcTypeMapping {
|
||||
public static String getType(String jdbcType, Table table, Column column) {
|
||||
if (typeMapper != null) {
|
||||
String type = typeMapper.getType(jdbcType, table, column);
|
||||
if (StringUtil.isNotBlank(type)) {
|
||||
if (StringUtil.hasText(type)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
String registered = mapping.get(jdbcType);
|
||||
return StringUtil.isNotBlank(registered) ? registered : jdbcType;
|
||||
return StringUtil.hasText(registered) ? registered : jdbcType;
|
||||
}
|
||||
|
||||
public interface JdbcTypeMapper {
|
||||
|
||||
@ -24,6 +24,6 @@ import com.mybatisflex.core.util.StringUtil;
|
||||
public class DefaultJdbcDialect extends AbstractJdbcDialect {
|
||||
@Override
|
||||
protected String forBuildColumnsSql(String schema, String tableName) {
|
||||
return "SELECT * FROM " + (StringUtil.isNotBlank(schema) ? schema + "." : "") + tableName + " WHERE 1 = 2";
|
||||
return "SELECT * FROM " + (StringUtil.hasText(schema) ? schema + "." : "") + tableName + " WHERE 1 = 2";
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,6 +24,6 @@ import com.mybatisflex.core.util.StringUtil;
|
||||
public class MySqlJdbcDialect extends AbstractJdbcDialect {
|
||||
@Override
|
||||
protected String forBuildColumnsSql(String schema, String tableName) {
|
||||
return "SELECT * FROM `" + (StringUtil.isNotBlank(schema) ? schema + "`.`" : "") + tableName + "` WHERE 1 = 2";
|
||||
return "SELECT * FROM `" + (StringUtil.hasText(schema) ? schema + "`.`" : "") + tableName + "` WHERE 1 = 2";
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,19 +36,19 @@ public class OracleJdbcDialect extends AbstractJdbcDialect {
|
||||
|
||||
@Override
|
||||
public String forBuildColumnsSql(String schema, String tableName) {
|
||||
return "SELECT * FROM \"" + (StringUtil.isNotBlank(schema) ? schema + "\".\"" : "") + tableName + "\" WHERE rownum < 1";
|
||||
return "SELECT * FROM \"" + (StringUtil.hasText(schema) ? schema + "\".\"" : "") + tableName + "\" WHERE rownum < 1";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultSet getTablesResultSet(DatabaseMetaData dbMeta, Connection conn, String schema, String[] types) throws SQLException {
|
||||
return dbMeta.getTables(conn.getCatalog(), StringUtil.isNotBlank(schema) ? schema : dbMeta.getUserName(), null, types);
|
||||
return dbMeta.getTables(conn.getCatalog(), StringUtil.hasText(schema) ? schema : dbMeta.getUserName(), null, types);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResultSet forRemarks(String schema, Table table, DatabaseMetaData dbMeta, Connection conn) throws SQLException {
|
||||
if (conn instanceof OracleConnection) {
|
||||
((OracleConnection) conn).setRemarksReporting(true);
|
||||
return dbMeta.getColumns(conn.getCatalog(), StringUtil.isNotBlank(schema) ? schema : dbMeta.getUserName(), table.getName(), null);
|
||||
return dbMeta.getColumns(conn.getCatalog(), StringUtil.hasText(schema) ? schema : dbMeta.getUserName(), table.getName(), null);
|
||||
} else if ("com.zaxxer.hikari.pool.HikariProxyConnection".equals(conn.getClass().getName())) {
|
||||
return forRemarks(schema, table, dbMeta, getOriginalConn(HikariProxyConnection.class, "delegate", conn));
|
||||
} else if ("com.alibaba.druid.pool.DruidPooledConnection".equals(conn.getClass().getName())) {
|
||||
|
||||
@ -24,6 +24,6 @@ import com.mybatisflex.core.util.StringUtil;
|
||||
public class PostgreSQLJdbcDialect extends AbstractJdbcDialect {
|
||||
@Override
|
||||
protected String forBuildColumnsSql(String schema, String tableName) {
|
||||
return "SELECT * FROM " + (StringUtil.isNotBlank(schema) ? schema + "." : "") + "\"" + tableName + "\"" + " WHERE 1 = 2";
|
||||
return "SELECT * FROM " + (StringUtil.hasText(schema) ? schema + "." : "") + "\"" + tableName + "\"" + " WHERE 1 = 2";
|
||||
}
|
||||
}
|
||||
|
||||
@ -193,7 +193,7 @@ public class Column {
|
||||
}
|
||||
|
||||
public String buildComment() {
|
||||
if (StringUtil.isBlank(comment)) {
|
||||
if (StringUtil.noText(comment)) {
|
||||
return "";
|
||||
} else {
|
||||
return "/**\n" +
|
||||
@ -260,7 +260,7 @@ public class Column {
|
||||
}
|
||||
|
||||
|
||||
if (entityConfig != null && entityConfig.isColumnCommentEnable() && StringUtil.isNotBlank(comment)) {
|
||||
if (entityConfig != null && entityConfig.isColumnCommentEnable() && StringUtil.hasText(comment)) {
|
||||
addComma(annotations, needComma);
|
||||
annotations.append("comment = \"")
|
||||
.append(this.comment.replace("\n", "")
|
||||
@ -282,7 +282,7 @@ public class Column {
|
||||
|
||||
boolean needGenColumnAnnotation = (entityConfig != null && entityConfig.isAlwaysGenColumnAnnotation())
|
||||
|| !name.equalsIgnoreCase(StringUtil.camelToUnderline(property))
|
||||
|| (entityConfig != null && entityConfig.isColumnCommentEnable() && StringUtil.isNotBlank(this.comment) && annotations.length() == 0);
|
||||
|| (entityConfig != null && entityConfig.isColumnCommentEnable() && StringUtil.hasText(this.comment) && annotations.length() == 0);
|
||||
|
||||
StringBuilder columnAnnotation = new StringBuilder("@Column(");
|
||||
|
||||
@ -344,7 +344,7 @@ public class Column {
|
||||
columnAnnotation.append("tenantId = true");
|
||||
needComma = true;
|
||||
}
|
||||
if (entityConfig != null && entityConfig.isColumnCommentEnable() && StringUtil.isNotBlank(comment)) {
|
||||
if (entityConfig != null && entityConfig.isColumnCommentEnable() && StringUtil.hasText(comment)) {
|
||||
addComma(columnAnnotation, needComma);
|
||||
columnAnnotation.append("comment = \"")
|
||||
.append(this.comment.replace("\n", "")
|
||||
@ -419,7 +419,7 @@ public class Column {
|
||||
|
||||
boolean needGenColumnAnnotation = (entityConfig != null && entityConfig.isAlwaysGenColumnAnnotation())
|
||||
|| !name.equalsIgnoreCase(StringUtil.camelToUnderline(property))
|
||||
|| (entityConfig != null && entityConfig.isColumnCommentEnable() && StringUtil.isNotBlank(this.comment));
|
||||
|| (entityConfig != null && entityConfig.isColumnCommentEnable() && StringUtil.hasText(this.comment));
|
||||
|
||||
if (columnConfig.getOnInsertValue() != null
|
||||
|| columnConfig.getOnUpdateValue() != null
|
||||
|
||||
@ -97,7 +97,7 @@ public class Table {
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
if (StringUtil.isNotBlank(comment)) {
|
||||
if (StringUtil.hasText(comment)) {
|
||||
return globalConfig.getJavadocConfig().formatTableComment(comment);
|
||||
}
|
||||
return null;
|
||||
@ -148,7 +148,7 @@ public class Table {
|
||||
|
||||
|
||||
public boolean containsColumn(String columnName) {
|
||||
if (columns == null || columns.isEmpty() || StringUtil.isBlank(columnName)) {
|
||||
if (columns == null || columns.isEmpty() || StringUtil.noText(columnName)) {
|
||||
return false;
|
||||
}
|
||||
for (Column column : columns) {
|
||||
@ -302,7 +302,7 @@ public class Table {
|
||||
if (tableConfig == null) {
|
||||
// 未配置 tableConfig 以策略中的 schema 为主
|
||||
globalSchema = schema;
|
||||
} else if (StringUtil.isBlank(tableConfig.getSchema())) {
|
||||
} else if (StringUtil.noText(tableConfig.getSchema())) {
|
||||
// 配置 tableConfig 但未指定 schema 还是以策略中的 schema 为主
|
||||
globalSchema = schema;
|
||||
} else {
|
||||
@ -310,19 +310,19 @@ public class Table {
|
||||
globalSchema = null;
|
||||
}
|
||||
|
||||
if (StringUtil.isNotBlank(globalSchema)) {
|
||||
if (StringUtil.hasText(globalSchema)) {
|
||||
tableAnnotation.append(", schema = \"").append(globalSchema).append("\"");
|
||||
}
|
||||
|
||||
// 添加 dataSource 配置,因为代码生成器是一个数据源生成的,所以这些实体类应该都是一个数据源。
|
||||
String dataSource = globalConfig.getEntityDataSource();
|
||||
if (StringUtil.isNotBlank(dataSource)) {
|
||||
if (StringUtil.hasText(dataSource)) {
|
||||
tableAnnotation.append(", dataSource = \"").append(dataSource).append("\"");
|
||||
}
|
||||
|
||||
|
||||
if (tableConfig != null) {
|
||||
if (StringUtil.isNotBlank(tableConfig.getSchema())) {
|
||||
if (StringUtil.hasText(tableConfig.getSchema())) {
|
||||
tableAnnotation.append(", schema = \"").append(tableConfig.getSchema()).append("\"");
|
||||
}
|
||||
if (tableConfig.getCamelToUnderline() != null) {
|
||||
@ -343,7 +343,7 @@ public class Table {
|
||||
}
|
||||
|
||||
|
||||
if (entityConfig != null && entityConfig.isColumnCommentEnable() && StringUtil.isNotBlank(comment)) {
|
||||
if (entityConfig != null && entityConfig.isColumnCommentEnable() && StringUtil.hasText(comment)) {
|
||||
tableAnnotation.append(", comment = \"")
|
||||
.append(this.comment.replace("\n", "").replace("\"", "\\\"").trim())
|
||||
.append("\"");
|
||||
|
||||
@ -55,7 +55,7 @@ public class ControllerGenerator implements IGenerator {
|
||||
PackageConfig packageConfig = globalConfig.getPackageConfig();
|
||||
ControllerConfig controllerConfig = globalConfig.getControllerConfig();
|
||||
|
||||
String sourceDir = StringUtil.isNotBlank(controllerConfig.getSourceDir()) ? controllerConfig.getSourceDir() : packageConfig.getSourceDir();
|
||||
String sourceDir = StringUtil.hasText(controllerConfig.getSourceDir()) ? controllerConfig.getSourceDir() : packageConfig.getSourceDir();
|
||||
|
||||
String controllerPackagePath = packageConfig.getControllerPackage().replace(".", "/");
|
||||
File controllerJavaFile = new File(sourceDir, controllerPackagePath + "/" +
|
||||
|
||||
@ -68,7 +68,7 @@ public class EntityGenerator implements IGenerator {
|
||||
PackageConfig packageConfig = globalConfig.getPackageConfig();
|
||||
EntityConfig entityConfig = globalConfig.getEntityConfig();
|
||||
|
||||
String sourceDir = StringUtil.isNotBlank(entityConfig.getSourceDir()) ? entityConfig.getSourceDir() : packageConfig.getSourceDir();
|
||||
String sourceDir = StringUtil.hasText(entityConfig.getSourceDir()) ? entityConfig.getSourceDir() : packageConfig.getSourceDir();
|
||||
|
||||
String entityPackagePath = packageConfig.getEntityPackage().replace(".", "/");
|
||||
String entityClassName = table.buildEntityClassName();
|
||||
@ -107,7 +107,7 @@ public class EntityGenerator implements IGenerator {
|
||||
String baseClassName = table.buildEntityClassName() + entityConfig.getWithBaseClassSuffix();
|
||||
params.put("baseClassName", baseClassName);
|
||||
|
||||
String baseClassPackage = StringUtil.isNotBlank(entityConfig.getWithBasePackage())
|
||||
String baseClassPackage = StringUtil.hasText(entityConfig.getWithBasePackage())
|
||||
? entityConfig.getWithBasePackage() : packageConfig.getEntityPackage() + ".base";
|
||||
params.put("baseClassPackage", baseClassPackage);
|
||||
|
||||
@ -129,10 +129,10 @@ public class EntityGenerator implements IGenerator {
|
||||
}
|
||||
|
||||
PackageConfig packageConfig = globalConfig.getPackageConfig();
|
||||
String sourceDir = StringUtil.isNotBlank(entityConfig.getSourceDir()) ? entityConfig.getSourceDir() : packageConfig.getSourceDir();
|
||||
String sourceDir = StringUtil.hasText(entityConfig.getSourceDir()) ? entityConfig.getSourceDir() : packageConfig.getSourceDir();
|
||||
|
||||
String baseEntityPackagePath = packageConfig.getEntityPackage().replace(".", "/");
|
||||
baseEntityPackagePath = StringUtil.isNotBlank(entityConfig.getWithBasePackage()) ? entityConfig.getWithBasePackage().replace(".", "")
|
||||
baseEntityPackagePath = StringUtil.hasText(entityConfig.getWithBasePackage()) ? entityConfig.getWithBasePackage().replace(".", "")
|
||||
: baseEntityPackagePath + "/base";
|
||||
|
||||
String baseEntityClassName = table.buildEntityClassName() + entityConfig.getWithBaseClassSuffix();
|
||||
|
||||
@ -55,7 +55,7 @@ public class MapperGenerator implements IGenerator {
|
||||
PackageConfig packageConfig = globalConfig.getPackageConfig();
|
||||
MapperConfig mapperConfig = globalConfig.getMapperConfig();
|
||||
|
||||
String sourceDir = StringUtil.isNotBlank(mapperConfig.getSourceDir()) ? mapperConfig.getSourceDir() : packageConfig.getSourceDir();
|
||||
String sourceDir = StringUtil.hasText(mapperConfig.getSourceDir()) ? mapperConfig.getSourceDir() : packageConfig.getSourceDir();
|
||||
|
||||
String mapperPackagePath = packageConfig.getMapperPackage().replace(".", "/");
|
||||
File mapperJavaFile = new File(sourceDir, mapperPackagePath + "/" +
|
||||
|
||||
@ -55,7 +55,7 @@ public class ServiceGenerator implements IGenerator {
|
||||
PackageConfig packageConfig = globalConfig.getPackageConfig();
|
||||
ServiceConfig serviceConfig = globalConfig.getServiceConfig();
|
||||
|
||||
String sourceDir = StringUtil.isNotBlank(serviceConfig.getSourceDir()) ? serviceConfig.getSourceDir() : packageConfig.getSourceDir();
|
||||
String sourceDir = StringUtil.hasText(serviceConfig.getSourceDir()) ? serviceConfig.getSourceDir() : packageConfig.getSourceDir();
|
||||
|
||||
String servicePackagePath = packageConfig.getServicePackage().replace(".", "/");
|
||||
File serviceJavaFile = new File(sourceDir, servicePackagePath + "/" +
|
||||
|
||||
@ -55,7 +55,7 @@ public class ServiceImplGenerator implements IGenerator {
|
||||
PackageConfig packageConfig = globalConfig.getPackageConfig();
|
||||
ServiceImplConfig serviceImplConfig = globalConfig.getServiceImplConfig();
|
||||
|
||||
String sourceDir = StringUtil.isNotBlank(serviceImplConfig.getSourceDir()) ? serviceImplConfig.getSourceDir() : packageConfig.getSourceDir();
|
||||
String sourceDir = StringUtil.hasText(serviceImplConfig.getSourceDir()) ? serviceImplConfig.getSourceDir() : packageConfig.getSourceDir();
|
||||
|
||||
String serviceImplPackagePath = packageConfig.getServiceImplPackage().replace(".", "/");
|
||||
File serviceImplJavaFile = new File(sourceDir, serviceImplPackagePath + "/" +
|
||||
|
||||
@ -55,7 +55,7 @@ public class TableDefGenerator implements IGenerator {
|
||||
PackageConfig packageConfig = globalConfig.getPackageConfig();
|
||||
TableDefConfig tableDefConfig = globalConfig.getTableDefConfig();
|
||||
|
||||
String sourceDir = StringUtil.isNotBlank(tableDefConfig.getSourceDir()) ? tableDefConfig.getSourceDir() : packageConfig.getSourceDir();
|
||||
String sourceDir = StringUtil.hasText(tableDefConfig.getSourceDir()) ? tableDefConfig.getSourceDir() : packageConfig.getSourceDir();
|
||||
|
||||
String tableDefPackagePath = packageConfig.getTableDefPackage().replace(".", "/");
|
||||
File tableDefJavaFile = new File(sourceDir, tableDefPackagePath + "/" +
|
||||
|
||||
@ -31,10 +31,7 @@ import com.mybatisflex.core.row.Db;
|
||||
import com.mybatisflex.core.row.Row;
|
||||
import com.mybatisflex.core.table.TableInfo;
|
||||
import com.mybatisflex.core.table.TableInfoFactory;
|
||||
import com.mybatisflex.core.util.ClassUtil;
|
||||
import com.mybatisflex.core.util.CollectionUtil;
|
||||
import com.mybatisflex.core.util.ConvertUtil;
|
||||
import com.mybatisflex.core.util.MapperUtil;
|
||||
import com.mybatisflex.core.util.*;
|
||||
import org.apache.ibatis.annotations.DeleteProvider;
|
||||
import org.apache.ibatis.annotations.InsertProvider;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -250,7 +247,7 @@ public interface BaseMapper<T> {
|
||||
default int insertOrUpdate(T entity, boolean ignoreNulls) {
|
||||
TableInfo tableInfo = TableInfoFactory.ofEntityClass(entity.getClass());
|
||||
Object[] pkArgs = tableInfo.buildPkSqlArgs(entity);
|
||||
if (pkArgs.length == 0 || pkArgs[0] == null) {
|
||||
if (pkArgs.length == 0 || pkArgs[0] == null || (pkArgs[0] instanceof String && StringUtil.noText((String) pkArgs[0]))) {
|
||||
return insert(entity, ignoreNulls);
|
||||
} else {
|
||||
return update(entity, ignoreNulls);
|
||||
|
||||
@ -103,7 +103,7 @@ public class AuditManager {
|
||||
return supplier.execute();
|
||||
}
|
||||
String key = DataSourceKey.get();
|
||||
if (StringUtil.isBlank(key)) {
|
||||
if (StringUtil.noText(key)) {
|
||||
key = FlexGlobalConfig.getDefaultConfig()
|
||||
.getDataSource()
|
||||
.getDefaultDataSourceKey();
|
||||
|
||||
@ -116,7 +116,7 @@ public class HttpUtil {
|
||||
}
|
||||
|
||||
public static void setCharSet(String charSet) {
|
||||
if (StringUtil.isBlank(charSet)) {
|
||||
if (StringUtil.noText(charSet)) {
|
||||
throw new IllegalArgumentException("charSet can not be blank.");
|
||||
}
|
||||
HttpUtil.CHARSET = charSet;
|
||||
@ -232,7 +232,7 @@ public class HttpUtil {
|
||||
|
||||
String key = entry.getKey();
|
||||
String value = entry.getValue();
|
||||
if (StringUtil.isNotBlank(value)) {
|
||||
if (StringUtil.hasText(value)) {
|
||||
try {
|
||||
value = URLEncoder.encode(value, CHARSET);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
|
||||
@ -49,15 +49,15 @@ public class DataSourceBuilder {
|
||||
public DataSource build() {
|
||||
String dataSourceClassName = null;
|
||||
String type = dataSourceProperties.get("type");
|
||||
if (StringUtil.isNotBlank(type)) {
|
||||
if (StringUtil.hasText(type)) {
|
||||
dataSourceClassName = dataSourceAlias.getOrDefault(type, type);
|
||||
} else {
|
||||
dataSourceClassName = detectDataSourceClass();
|
||||
}
|
||||
|
||||
|
||||
if (StringUtil.isBlank(dataSourceClassName)) {
|
||||
if (StringUtil.isBlank(type)) {
|
||||
if (StringUtil.noText(dataSourceClassName)) {
|
||||
if (StringUtil.noText(type)) {
|
||||
throw FlexExceptions.wrap(LocalizedFormats.DATASOURCE_TYPE_BLANK);
|
||||
} else {
|
||||
throw FlexExceptions.wrap(LocalizedFormats.DATASOURCE_TYPE_NOT_FIND, type);
|
||||
|
||||
@ -112,9 +112,9 @@ public class FlexDataSource extends AbstractDataSource {
|
||||
@Override
|
||||
public Connection getConnection() throws SQLException {
|
||||
String xid = TransactionContext.getXID();
|
||||
if (StringUtil.isNotBlank(xid)) {
|
||||
if (StringUtil.hasText(xid)) {
|
||||
String dataSourceKey = DataSourceKey.get();
|
||||
if (StringUtil.isBlank(dataSourceKey)) {
|
||||
if (StringUtil.noText(dataSourceKey)) {
|
||||
dataSourceKey = defaultDataSourceKey;
|
||||
}
|
||||
|
||||
@ -133,9 +133,9 @@ public class FlexDataSource extends AbstractDataSource {
|
||||
@Override
|
||||
public Connection getConnection(String username, String password) throws SQLException {
|
||||
String xid = TransactionContext.getXID();
|
||||
if (StringUtil.isNotBlank(xid)) {
|
||||
if (StringUtil.hasText(xid)) {
|
||||
String dataSourceKey = DataSourceKey.get();
|
||||
if (StringUtil.isBlank(dataSourceKey)) {
|
||||
if (StringUtil.noText(dataSourceKey)) {
|
||||
dataSourceKey = defaultDataSourceKey;
|
||||
}
|
||||
Connection connection = TransactionalManager.getConnection(xid, dataSourceKey);
|
||||
@ -206,7 +206,7 @@ public class FlexDataSource extends AbstractDataSource {
|
||||
DataSource dataSource = defaultDataSource;
|
||||
if (dataSourceMap.size() > 1) {
|
||||
String dataSourceKey = DataSourceKey.get();
|
||||
if (StringUtil.isNotBlank(dataSourceKey)) {
|
||||
if (StringUtil.hasText(dataSourceKey)) {
|
||||
//负载均衡 key
|
||||
if (dataSourceKey.charAt(dataSourceKey.length() - 1) == LOAD_BALANCE_KEY_SUFFIX) {
|
||||
String prefix = dataSourceKey.substring(0, dataSourceKey.length() - 1);
|
||||
|
||||
@ -40,7 +40,7 @@ public class DbTypeUtil {
|
||||
public static DbType getDbType(DataSource dataSource) {
|
||||
String jdbcUrl = getJdbcUrl(dataSource);
|
||||
|
||||
if (StringUtil.isNotBlank(jdbcUrl)) {
|
||||
if (StringUtil.hasText(jdbcUrl)) {
|
||||
return parseDbType(jdbcUrl);
|
||||
}
|
||||
|
||||
|
||||
@ -115,7 +115,7 @@ public class KeywordWrap {
|
||||
}
|
||||
|
||||
public String wrap(String keyword) {
|
||||
if (StringUtil.isBlank(keyword) || SqlConsts.ASTERISK.equals(keyword.trim())) {
|
||||
if (StringUtil.noText(keyword) || SqlConsts.ASTERISK.equals(keyword.trim())) {
|
||||
return keyword;
|
||||
}
|
||||
|
||||
@ -146,7 +146,7 @@ public class KeywordWrap {
|
||||
|
||||
//sqlserver 转义 scheme table colums 包装 根据 . 分割后分别包装
|
||||
public String wrap4Sqlserver(String keyword) {
|
||||
if (StringUtil.isBlank(keyword) || SqlConsts.ASTERISK.equals(keyword.trim())) {
|
||||
if (StringUtil.noText(keyword) || SqlConsts.ASTERISK.equals(keyword.trim())) {
|
||||
return keyword;
|
||||
}
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@ public class ClickhouseDialectImpl extends CommonsDialectImpl {
|
||||
String[] primaryKeys = RowCPI.obtainsPrimaryKeyStrings(row);
|
||||
|
||||
sql.append(ALTER_TABLE);
|
||||
if (StringUtil.isNotBlank(schema)) {
|
||||
if (StringUtil.hasText(schema)) {
|
||||
sql.append(wrap(getRealSchema(schema, table, OperateType.UPDATE))).append(REFERENCE);
|
||||
}
|
||||
sql.append(wrap(table)).append(CK_UPDATE);
|
||||
@ -118,7 +118,7 @@ public class ClickhouseDialectImpl extends CommonsDialectImpl {
|
||||
StringBuilder sql = new StringBuilder();
|
||||
|
||||
sql.append(ALTER_TABLE);
|
||||
if (StringUtil.isNotBlank(schema)) {
|
||||
if (StringUtil.hasText(schema)) {
|
||||
sql.append(wrap(getRealSchema(schema, table, OperateType.DELETE))).append(REFERENCE);
|
||||
}
|
||||
sql.append(wrap(table));
|
||||
@ -206,7 +206,7 @@ public class ClickhouseDialectImpl extends CommonsDialectImpl {
|
||||
String table = getRealTable(tableName, OperateType.DELETE);
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append(ALTER_TABLE);
|
||||
if (StringUtil.isNotBlank(schema)) {
|
||||
if (StringUtil.hasText(schema)) {
|
||||
sql.append(wrap(getRealSchema(schema, table, OperateType.DELETE))).append(REFERENCE);
|
||||
}
|
||||
sql.append(wrap(table));
|
||||
@ -256,7 +256,7 @@ public class ClickhouseDialectImpl extends CommonsDialectImpl {
|
||||
Object[] tenantIdArgs = tableInfo.buildTenantIdArgs();
|
||||
|
||||
// 正常删除
|
||||
if (StringUtil.isBlank(logicDeleteColumn)) {
|
||||
if (StringUtil.noText(logicDeleteColumn)) {
|
||||
String deleteSQL = forDeleteBatchByIds(tableInfo.getSchema(), tableInfo.getTableName(), tableInfo.getPrimaryColumns(), primaryValues);
|
||||
|
||||
// 多租户
|
||||
@ -322,7 +322,7 @@ public class ClickhouseDialectImpl extends CommonsDialectImpl {
|
||||
// ignore selectColumns
|
||||
StringBuilder sqlBuilder = new StringBuilder(ALTER_TABLE);
|
||||
String hint = CPI.getHint(queryWrapper);
|
||||
if (StringUtil.isNotBlank(hint)) {
|
||||
if (StringUtil.hasText(hint)) {
|
||||
sqlBuilder.append(BLANK).append(hint).deleteCharAt(sqlBuilder.length() - 1);
|
||||
}
|
||||
|
||||
@ -357,7 +357,7 @@ public class ClickhouseDialectImpl extends CommonsDialectImpl {
|
||||
String logicDeleteColumn = tableInfo.getLogicDeleteColumnOrSkip();
|
||||
|
||||
// 正常删除
|
||||
if (StringUtil.isBlank(logicDeleteColumn)) {
|
||||
if (StringUtil.noText(logicDeleteColumn)) {
|
||||
return forDeleteByQuery(queryWrapper);
|
||||
}
|
||||
|
||||
@ -418,7 +418,7 @@ public class ClickhouseDialectImpl extends CommonsDialectImpl {
|
||||
|
||||
// 乐观锁字段
|
||||
String versionColumn = tableInfo.getVersionColumn();
|
||||
if (StringUtil.isNotBlank(tableInfo.getOptimisticLockColumnOrSkip())) {
|
||||
if (StringUtil.hasText(tableInfo.getOptimisticLockColumnOrSkip())) {
|
||||
stringJoiner.add(wrap(versionColumn) + EQUALS + wrap(versionColumn) + " + 1 ");
|
||||
}
|
||||
|
||||
@ -434,7 +434,7 @@ public class ClickhouseDialectImpl extends CommonsDialectImpl {
|
||||
|
||||
// 逻辑删除条件,已删除的数据不能被修改
|
||||
String logicDeleteColumn = tableInfo.getLogicDeleteColumnOrSkip();
|
||||
if (StringUtil.isNotBlank(logicDeleteColumn)) {
|
||||
if (StringUtil.hasText(logicDeleteColumn)) {
|
||||
sql.append(AND).append(buildLogicNormalCondition(logicDeleteColumn, tableInfo));
|
||||
}
|
||||
|
||||
@ -444,7 +444,7 @@ public class ClickhouseDialectImpl extends CommonsDialectImpl {
|
||||
tableInfo.buildTenantCondition(sql, tenantIdArgs, this);
|
||||
|
||||
// 乐观锁条件
|
||||
if (StringUtil.isNotBlank(versionColumn)) {
|
||||
if (StringUtil.hasText(versionColumn)) {
|
||||
Object versionValue = tableInfo.buildColumnSqlArg(entity, versionColumn);
|
||||
if (versionValue == null) {
|
||||
throw FlexExceptions.wrap(LocalizedFormats.ENTITY_VERSION_NULL, entity);
|
||||
@ -491,7 +491,7 @@ public class ClickhouseDialectImpl extends CommonsDialectImpl {
|
||||
|
||||
// 乐观锁字段
|
||||
String versionColumn = tableInfo.getVersionColumn();
|
||||
if (StringUtil.isNotBlank(tableInfo.getOptimisticLockColumnOrSkip())) {
|
||||
if (StringUtil.hasText(tableInfo.getOptimisticLockColumnOrSkip())) {
|
||||
stringJoiner.add(wrap(versionColumn) + EQUALS + wrap(versionColumn) + " + 1 ");
|
||||
}
|
||||
|
||||
|
||||
@ -113,7 +113,7 @@ public class CommonsDialectImpl implements IDialect {
|
||||
|
||||
@Override
|
||||
public String forHint(String hintString) {
|
||||
return StringUtil.isNotBlank(hintString) ? HINT_START + hintString + HINT_END : EMPTY;
|
||||
return StringUtil.hasText(hintString) ? HINT_START + hintString + HINT_END : EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -143,7 +143,7 @@ public class CommonsDialectImpl implements IDialect {
|
||||
String table = getRealTable(tableName, OperateType.INSERT);
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append(INSERT_INTO);
|
||||
if (StringUtil.isNotBlank(schema)) {
|
||||
if (StringUtil.hasText(schema)) {
|
||||
sql.append(wrap(getRealSchema(schema, table, OperateType.INSERT))).append(REFERENCE);
|
||||
}
|
||||
sql.append(wrap(table));
|
||||
@ -179,7 +179,7 @@ public class CommonsDialectImpl implements IDialect {
|
||||
String table = getRealTable(tableName, OperateType.INSERT);
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append(INSERT_INTO);
|
||||
if (StringUtil.isNotBlank(schema)) {
|
||||
if (StringUtil.hasText(schema)) {
|
||||
sql.append(wrap(getRealSchema(schema, table, OperateType.INSERT))).append(REFERENCE);
|
||||
}
|
||||
sql.append(wrap(table));
|
||||
@ -196,7 +196,7 @@ public class CommonsDialectImpl implements IDialect {
|
||||
String table = getRealTable(tableName, OperateType.DELETE);
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append(DELETE_FROM);
|
||||
if (StringUtil.isNotBlank(schema)) {
|
||||
if (StringUtil.hasText(schema)) {
|
||||
sql.append(wrap(getRealSchema(schema, table, OperateType.DELETE))).append(REFERENCE);
|
||||
}
|
||||
sql.append(wrap(table));
|
||||
@ -217,7 +217,7 @@ public class CommonsDialectImpl implements IDialect {
|
||||
String table = getRealTable(tableName, OperateType.DELETE);
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append(DELETE_FROM);
|
||||
if (StringUtil.isNotBlank(schema)) {
|
||||
if (StringUtil.hasText(schema)) {
|
||||
sql.append(wrap(getRealSchema(schema, table, OperateType.DELETE))).append(REFERENCE);
|
||||
}
|
||||
|
||||
@ -268,7 +268,7 @@ public class CommonsDialectImpl implements IDialect {
|
||||
String[] primaryKeys = RowCPI.obtainsPrimaryKeyStrings(row);
|
||||
|
||||
sql.append(UPDATE);
|
||||
if (StringUtil.isNotBlank(schema)) {
|
||||
if (StringUtil.hasText(schema)) {
|
||||
sql.append(wrap(getRealSchema(schema, table, OperateType.UPDATE))).append(REFERENCE);
|
||||
}
|
||||
|
||||
@ -369,7 +369,7 @@ public class CommonsDialectImpl implements IDialect {
|
||||
public String forSelectOneById(String schema, String tableName, String[] primaryKeys, Object[] primaryValues) {
|
||||
String table = getRealTable(tableName, OperateType.SELECT);
|
||||
StringBuilder sql = new StringBuilder(SELECT_ALL_FROM);
|
||||
if (StringUtil.isNotBlank(schema)) {
|
||||
if (StringUtil.hasText(schema)) {
|
||||
sql.append(wrap(getRealSchema(schema, table, OperateType.SELECT))).append(REFERENCE);
|
||||
}
|
||||
sql.append(wrap(table)).append(WHERE);
|
||||
@ -409,8 +409,8 @@ public class CommonsDialectImpl implements IDialect {
|
||||
.entrySet()
|
||||
.stream()
|
||||
// 需要处理别名的情况
|
||||
.filter(e -> StringUtil.isNotBlank(e.getValue().getName()))
|
||||
.filter(e -> StringUtil.isBlank(e.getValue().getAlias()))
|
||||
.filter(e -> StringUtil.hasText(e.getValue().getName()))
|
||||
.filter(e -> StringUtil.noText(e.getValue().getAlias()))
|
||||
.filter(e -> !"*".equals(e.getValue().getName()))
|
||||
// 将相同字段对象放在一个集合里
|
||||
.collect(Collectors.groupingBy(e -> e.getValue().getName(),
|
||||
@ -423,7 +423,7 @@ public class CommonsDialectImpl implements IDialect {
|
||||
.flatMap(Collection::stream)
|
||||
// 过滤出来可以添加别名的列
|
||||
.filter(e -> e.getValue().getTable() != null)
|
||||
.filter(e -> StringUtil.isNotBlank(e.getValue().getTable().getName()))
|
||||
.filter(e -> StringUtil.hasText(e.getValue().getTable().getName()))
|
||||
// 添加别名并放回原集合索引位置
|
||||
.forEach(e -> selectColumns.set(e.getKey(),
|
||||
e.getValue().as(e.getValue().getTable().getName() + "$" + e.getValue().getName())));
|
||||
@ -534,7 +534,7 @@ public class CommonsDialectImpl implements IDialect {
|
||||
// ignore selectColumns
|
||||
StringBuilder sqlBuilder = new StringBuilder(DELETE);
|
||||
String hint = CPI.getHint(queryWrapper);
|
||||
if (StringUtil.isNotBlank(hint)) {
|
||||
if (StringUtil.hasText(hint)) {
|
||||
sqlBuilder.append(BLANK).append(hint).deleteCharAt(sqlBuilder.length() - 1);
|
||||
}
|
||||
|
||||
@ -547,7 +547,7 @@ public class CommonsDialectImpl implements IDialect {
|
||||
}
|
||||
QueryTable queryTable = queryTables.get(0);
|
||||
String table = getRealTable(queryTable.getName(), OperateType.DELETE);
|
||||
if (StringUtil.isNotBlank(queryTable.getSchema())) {
|
||||
if (StringUtil.hasText(queryTable.getSchema())) {
|
||||
sqlBuilder.append(wrap(getRealSchema(queryTable.getSchema(), table, OperateType.DELETE))).append(REFERENCE);
|
||||
}
|
||||
sqlBuilder.append(BLANK).append(wrap(getRealTable(table, OperateType.DELETE)));
|
||||
@ -692,7 +692,7 @@ public class CommonsDialectImpl implements IDialect {
|
||||
Object[] tenantIdArgs = tableInfo.buildTenantIdArgs();
|
||||
|
||||
// 正常删除
|
||||
if (StringUtil.isBlank(logicDeleteColumn)) {
|
||||
if (StringUtil.noText(logicDeleteColumn)) {
|
||||
String deleteByIdSql = forDeleteById(tableInfo.getSchema(), tableInfo.getTableName(), tableInfo.getPrimaryColumns());
|
||||
return tableInfo.buildTenantCondition(deleteByIdSql, tenantIdArgs, this);
|
||||
}
|
||||
@ -726,7 +726,7 @@ public class CommonsDialectImpl implements IDialect {
|
||||
Object[] tenantIdArgs = tableInfo.buildTenantIdArgs();
|
||||
|
||||
// 正常删除
|
||||
if (StringUtil.isBlank(logicDeleteColumn)) {
|
||||
if (StringUtil.noText(logicDeleteColumn)) {
|
||||
String deleteSQL = forDeleteBatchByIds(tableInfo.getSchema(), tableInfo.getTableName(), tableInfo.getPrimaryColumns(), primaryValues);
|
||||
|
||||
// 多租户
|
||||
@ -785,7 +785,7 @@ public class CommonsDialectImpl implements IDialect {
|
||||
String logicDeleteColumn = tableInfo.getLogicDeleteColumnOrSkip();
|
||||
|
||||
// 正常删除
|
||||
if (StringUtil.isBlank(logicDeleteColumn)) {
|
||||
if (StringUtil.noText(logicDeleteColumn)) {
|
||||
return forDeleteByQuery(queryWrapper);
|
||||
}
|
||||
|
||||
@ -842,7 +842,7 @@ public class CommonsDialectImpl implements IDialect {
|
||||
|
||||
// 乐观锁字段
|
||||
String versionColumn = tableInfo.getVersionColumn();
|
||||
if (StringUtil.isNotBlank(tableInfo.getOptimisticLockColumnOrSkip())) {
|
||||
if (StringUtil.hasText(tableInfo.getOptimisticLockColumnOrSkip())) {
|
||||
stringJoiner.add(wrap(versionColumn) + EQUALS + wrap(versionColumn) + " + 1 ");
|
||||
}
|
||||
|
||||
@ -858,7 +858,7 @@ public class CommonsDialectImpl implements IDialect {
|
||||
|
||||
// 逻辑删除条件,已删除的数据不能被修改
|
||||
String logicDeleteColumn = tableInfo.getLogicDeleteColumnOrSkip();
|
||||
if (StringUtil.isNotBlank(logicDeleteColumn)) {
|
||||
if (StringUtil.hasText(logicDeleteColumn)) {
|
||||
sql.append(AND).append(buildLogicNormalCondition(logicDeleteColumn, tableInfo));
|
||||
}
|
||||
|
||||
@ -868,7 +868,7 @@ public class CommonsDialectImpl implements IDialect {
|
||||
tableInfo.buildTenantCondition(sql, tenantIdArgs, this);
|
||||
|
||||
// 乐观锁条件
|
||||
if (StringUtil.isNotBlank(tableInfo.getOptimisticLockColumnOrSkip())) {
|
||||
if (StringUtil.hasText(tableInfo.getOptimisticLockColumnOrSkip())) {
|
||||
Object versionValue = tableInfo.buildColumnSqlArg(entity, versionColumn);
|
||||
if (versionValue == null) {
|
||||
throw FlexExceptions.wrap(LocalizedFormats.ENTITY_VERSION_NULL, entity);
|
||||
@ -917,7 +917,7 @@ public class CommonsDialectImpl implements IDialect {
|
||||
|
||||
// 乐观锁字段
|
||||
String versionColumn = tableInfo.getVersionColumn();
|
||||
if (StringUtil.isNotBlank(tableInfo.getOptimisticLockColumnOrSkip())) {
|
||||
if (StringUtil.hasText(tableInfo.getOptimisticLockColumnOrSkip())) {
|
||||
stringJoiner.add(wrap(versionColumn) + EQUALS + wrap(versionColumn) + " + 1 ");
|
||||
}
|
||||
|
||||
@ -965,7 +965,7 @@ public class CommonsDialectImpl implements IDialect {
|
||||
|
||||
// 逻辑删除的情况下,需要添加逻辑删除的条件
|
||||
String logicDeleteColumn = tableInfo.getLogicDeleteColumnOrSkip();
|
||||
if (StringUtil.isNotBlank(logicDeleteColumn)) {
|
||||
if (StringUtil.hasText(logicDeleteColumn)) {
|
||||
sql.append(AND).append(buildLogicNormalCondition(logicDeleteColumn, tableInfo));
|
||||
}
|
||||
|
||||
@ -987,7 +987,7 @@ public class CommonsDialectImpl implements IDialect {
|
||||
|
||||
String logicDeleteColumn = tableInfo.getLogicDeleteColumnOrSkip();
|
||||
Object[] tenantIdArgs = tableInfo.buildTenantIdArgs();
|
||||
if (StringUtil.isNotBlank(logicDeleteColumn) || ArrayUtil.isNotEmpty(tenantIdArgs)) {
|
||||
if (StringUtil.hasText(logicDeleteColumn) || ArrayUtil.isNotEmpty(tenantIdArgs)) {
|
||||
sql.append(BRACKET_LEFT);
|
||||
}
|
||||
|
||||
@ -1017,12 +1017,12 @@ public class CommonsDialectImpl implements IDialect {
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtil.isNotBlank(logicDeleteColumn) || ArrayUtil.isNotEmpty(tenantIdArgs)) {
|
||||
if (StringUtil.hasText(logicDeleteColumn) || ArrayUtil.isNotEmpty(tenantIdArgs)) {
|
||||
sql.append(BRACKET_RIGHT);
|
||||
}
|
||||
|
||||
|
||||
if (StringUtil.isNotBlank(logicDeleteColumn)) {
|
||||
if (StringUtil.hasText(logicDeleteColumn)) {
|
||||
sql.append(AND).append(buildLogicNormalCondition(logicDeleteColumn, tableInfo));
|
||||
}
|
||||
|
||||
@ -1053,7 +1053,7 @@ public class CommonsDialectImpl implements IDialect {
|
||||
QueryCondition whereQueryCondition = CPI.getWhereQueryCondition(queryWrapper);
|
||||
if (whereQueryCondition != null) {
|
||||
String whereSql = whereQueryCondition.toSql(queryTables, this);
|
||||
if (StringUtil.isNotBlank(whereSql)) {
|
||||
if (StringUtil.hasText(whereSql)) {
|
||||
sqlBuilder.append(WHERE).append(whereSql);
|
||||
} else if (!allowNoCondition) {
|
||||
throw FlexExceptions.wrap(LocalizedFormats.UPDATE_OR_DELETE_NOT_ALLOW);
|
||||
@ -1088,7 +1088,7 @@ public class CommonsDialectImpl implements IDialect {
|
||||
QueryCondition havingQueryCondition = CPI.getHavingQueryCondition(queryWrapper);
|
||||
if (havingQueryCondition != null) {
|
||||
String havingSql = havingQueryCondition.toSql(queryTables, this);
|
||||
if (StringUtil.isNotBlank(havingSql)) {
|
||||
if (StringUtil.hasText(havingSql)) {
|
||||
sqlBuilder.append(HAVING).append(havingSql);
|
||||
}
|
||||
}
|
||||
|
||||
@ -167,7 +167,7 @@ public class OracleDialect extends CommonsDialectImpl {
|
||||
sql.append(INSERT_ALL);
|
||||
|
||||
String table = getRealTable(tableName, OperateType.INSERT);
|
||||
String tableNameWrap = StringUtil.isNotBlank(schema)
|
||||
String tableNameWrap = StringUtil.hasText(schema)
|
||||
? wrap(getRealSchema(schema, table, OperateType.INSERT)) + REFERENCE + wrap(table)
|
||||
: wrap(table);
|
||||
String questionStrings = SqlUtil.buildSqlParamPlaceholder(attrs.size());
|
||||
|
||||
@ -34,19 +34,19 @@ public abstract class BaseJsonTypeHandler<T> extends BaseTypeHandler<T> {
|
||||
@Override
|
||||
public T getNullableResult(ResultSet rs, String columnName) throws SQLException {
|
||||
final String json = rs.getString(columnName);
|
||||
return StringUtil.isBlank(json) ? null : parseJson(json);
|
||||
return StringUtil.noText(json) ? null : parseJson(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
public T getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
|
||||
final String json = rs.getString(columnIndex);
|
||||
return StringUtil.isBlank(json) ? null : parseJson(json);
|
||||
return StringUtil.noText(json) ? null : parseJson(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
public T getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
|
||||
final String json = cs.getString(columnIndex);
|
||||
return StringUtil.isBlank(json) ? null : parseJson(json);
|
||||
return StringUtil.noText(json) ? null : parseJson(json);
|
||||
}
|
||||
|
||||
protected abstract T parseJson(String json);
|
||||
|
||||
@ -73,7 +73,7 @@ public class CustomKeyGenerator implements KeyGenerator {
|
||||
Object existId = tableInfo.getValue(entity, idInfo.getProperty());
|
||||
// 若用户主动设置了主键,则使用用户自己设置的主键,不再生成主键
|
||||
// 只有主键为 null 或者 空字符串时,对主键进行设置
|
||||
if (existId == null || (existId instanceof String && StringUtil.isBlank((String) existId))) {
|
||||
if (existId == null || (existId instanceof String && StringUtil.noText((String) existId))) {
|
||||
Configuration msConfiguration = ms.getConfiguration();
|
||||
MetaObject metaParam = msConfiguration.newMetaObject(parameter);
|
||||
Object generateId = keyGenerator.generate(entity, idInfo.getColumn());
|
||||
|
||||
@ -52,7 +52,7 @@ public class KeyGeneratorFactory {
|
||||
* @return 主键生成器
|
||||
*/
|
||||
public static IKeyGenerator getKeyGenerator(String name) {
|
||||
if (StringUtil.isBlank(name)) {
|
||||
if (StringUtil.noText(name)) {
|
||||
throw FlexExceptions.wrap(LocalizedFormats.KEY_GENERATOR_BLANK);
|
||||
}
|
||||
return KEY_GENERATOR_MAP.get(name.trim());
|
||||
|
||||
@ -81,7 +81,7 @@ public class MybatisKeyGeneratorUtil {
|
||||
|
||||
//通过序列生成的注解
|
||||
String sequence = getKeyValue(idInfo, globalKeyConfig);
|
||||
if (StringUtil.isBlank(sequence)) {
|
||||
if (StringUtil.noText(sequence)) {
|
||||
throw FlexExceptions.wrap("Please config sequence by @Id(value=\"...\") for field: %s in class: %s"
|
||||
, idInfo.getProperty()
|
||||
, tableInfo.getEntityClass().getName());
|
||||
@ -146,7 +146,7 @@ public class MybatisKeyGeneratorUtil {
|
||||
|
||||
public static String getKeyValue(IdInfo idInfo, FlexGlobalConfig.KeyConfig globalKeyConfig) {
|
||||
String value = idInfo.getValue();
|
||||
if (StringUtil.isBlank(value) && globalKeyConfig != null) {
|
||||
if (StringUtil.noText(value) && globalKeyConfig != null) {
|
||||
value = globalKeyConfig.getValue();
|
||||
}
|
||||
return value;
|
||||
|
||||
@ -60,7 +60,7 @@ public class RowCustomKeyGenerator implements KeyGenerator {
|
||||
Object existId = row.get(rowKey.getKeyColumn());
|
||||
// 若用户主动设置了主键,则使用用户自己设置的主键,不再生成主键
|
||||
// 只有主键为 null 或者 空字符串时,对主键进行设置
|
||||
if (existId == null || (existId instanceof String && StringUtil.isBlank((String) existId))) {
|
||||
if (existId == null || (existId instanceof String && StringUtil.noText((String) existId))) {
|
||||
Object generateId = keyGenerator.generate(row, rowKey.getKeyColumn());
|
||||
row.put(rowKey.getKeyColumn(), generateId);
|
||||
}
|
||||
|
||||
@ -152,7 +152,7 @@ public class SnowFlakeIDKeyGenerator implements IKeyGenerator {
|
||||
StringBuilder mpId = new StringBuilder();
|
||||
mpId.append(dataCenterId);
|
||||
String name = ManagementFactory.getRuntimeMXBean().getName();
|
||||
if (StringUtil.isNotBlank(name)) {
|
||||
if (StringUtil.hasText(name)) {
|
||||
// GET jvmPid
|
||||
mpId.append(name.split("@")[0]);
|
||||
}
|
||||
|
||||
@ -57,14 +57,14 @@ public class FlexMapperProxy<T> extends MybatisMapperProxy<T> {
|
||||
String finalDsKey = userDsKey;
|
||||
|
||||
try {
|
||||
if (StringUtil.isBlank(finalDsKey)) {
|
||||
if (StringUtil.noText(finalDsKey)) {
|
||||
finalDsKey = getMethodDsKey(method, proxy);
|
||||
}
|
||||
|
||||
//通过自定义分配策略去获取最终的数据源
|
||||
finalDsKey = DataSourceKey.getShardingDsKey(finalDsKey, proxy, method, args);
|
||||
|
||||
if (StringUtil.isNotBlank(finalDsKey) && !finalDsKey.equals(userDsKey)) {
|
||||
if (StringUtil.hasText(finalDsKey) && !finalDsKey.equals(userDsKey)) {
|
||||
needClearDsKey = true;
|
||||
DataSourceKey.use(finalDsKey);
|
||||
}
|
||||
@ -103,14 +103,14 @@ public class FlexMapperProxy<T> extends MybatisMapperProxy<T> {
|
||||
|
||||
private static String getMethodDsKey(Method method, Object proxy) {
|
||||
UseDataSource methodAnno = method.getAnnotation(UseDataSource.class);
|
||||
if (methodAnno != null && StringUtil.isNotBlank(methodAnno.value())) {
|
||||
if (methodAnno != null && StringUtil.hasText(methodAnno.value())) {
|
||||
return methodAnno.value();
|
||||
}
|
||||
|
||||
Class<?>[] interfaces = proxy.getClass().getInterfaces();
|
||||
for (Class<?> anInterface : interfaces) {
|
||||
UseDataSource classAnno = anInterface.getAnnotation(UseDataSource.class);
|
||||
if (classAnno != null && StringUtil.isNotBlank(classAnno.value())) {
|
||||
if (classAnno != null && StringUtil.hasText(classAnno.value())) {
|
||||
return classAnno.value();
|
||||
}
|
||||
}
|
||||
@ -119,7 +119,7 @@ public class FlexMapperProxy<T> extends MybatisMapperProxy<T> {
|
||||
TableInfo tableInfo = TableInfoFactory.ofMapperClass(interfaces[0]);
|
||||
if (tableInfo != null) {
|
||||
String tableDsKey = tableInfo.getDataSource();
|
||||
if (StringUtil.isNotBlank(tableDsKey)) {
|
||||
if (StringUtil.hasText(tableDsKey)) {
|
||||
return tableDsKey;
|
||||
}
|
||||
}
|
||||
|
||||
@ -407,7 +407,7 @@ public class EntitySqlProvider {
|
||||
tableInfos = new ArrayList<>();
|
||||
for (QueryTable queryTable : queryTables) {
|
||||
String tableNameWithSchema = queryTable.getNameWithSchema();
|
||||
if (StringUtil.isNotBlank(tableNameWithSchema)) {
|
||||
if (StringUtil.hasText(tableNameWithSchema)) {
|
||||
TableInfo tableInfo = TableInfoFactory.ofTableName(tableNameWithSchema);
|
||||
if (tableInfo != null) {
|
||||
tableInfos.add(tableInfo);
|
||||
|
||||
@ -65,7 +65,7 @@ class ProviderUtil {
|
||||
|
||||
public static String[] getPrimaryKeys(Map params) {
|
||||
String primaryKey = (String) params.get(FlexConsts.PRIMARY_KEY);
|
||||
if (StringUtil.isBlank(primaryKey)) {
|
||||
if (StringUtil.noText(primaryKey)) {
|
||||
throw FlexExceptions.wrap(LocalizedFormats.OBJECT_NULL_OR_BLANK, "primaryKey");
|
||||
}
|
||||
String[] primaryKeys = primaryKey.split(",");
|
||||
|
||||
@ -94,7 +94,7 @@ public class ArithmeticQueryColumn extends QueryColumn implements HasParamsColum
|
||||
for (int i = 0; i < arithmeticInfos.size(); i++) {
|
||||
sql.append(arithmeticInfos.get(i).toSql(queryTables, dialect, i));
|
||||
}
|
||||
if (StringUtil.isNotBlank(alias)) {
|
||||
if (StringUtil.hasText(alias)) {
|
||||
return WrapperUtil.withAlias(sql.toString(), alias, dialect);
|
||||
}
|
||||
return sql.toString();
|
||||
|
||||
@ -113,11 +113,11 @@ public class Brackets extends QueryCondition {
|
||||
StringBuilder sql = new StringBuilder();
|
||||
if (checkEffective()) {
|
||||
String childSql = childCondition.toSql(queryTables, dialect);
|
||||
if (StringUtil.isNotBlank(childSql)) {
|
||||
if (StringUtil.hasText(childSql)) {
|
||||
QueryCondition prevEffectiveCondition = getPrevEffectiveCondition();
|
||||
if (prevEffectiveCondition != null && this.connector != null) {
|
||||
childSql = this.connector + SqlConsts.BRACKET_LEFT + childSql + SqlConsts.BRACKET_RIGHT;
|
||||
} else if (StringUtil.isNotBlank(sqlNext)) {
|
||||
} else if (StringUtil.hasText(sqlNext)) {
|
||||
childSql = SqlConsts.BRACKET_LEFT + childSql + SqlConsts.BRACKET_RIGHT;
|
||||
}
|
||||
sql.append(childSql);
|
||||
|
||||
@ -245,14 +245,14 @@ public class CPI {
|
||||
}
|
||||
|
||||
public static void setFromIfNecessary(QueryWrapper queryWrapper, String tableName) {
|
||||
if (StringUtil.isNotBlank(tableName)
|
||||
if (StringUtil.hasText(tableName)
|
||||
&& CollectionUtil.isEmpty(queryWrapper.getQueryTables())) {
|
||||
queryWrapper.from(tableName);
|
||||
}
|
||||
}
|
||||
|
||||
public static void setFromIfNecessary(QueryWrapper queryWrapper, String schema, String tableName) {
|
||||
if (StringUtil.isNotBlank(tableName)
|
||||
if (StringUtil.hasText(tableName)
|
||||
&& CollectionUtil.isEmpty(queryWrapper.getQueryTables())) {
|
||||
queryWrapper.from(new QueryTable(schema, tableName));
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ public class CaseQueryColumn extends QueryColumn implements HasParamsColumn {
|
||||
@Override
|
||||
protected String toSelectSql(List<QueryTable> queryTables, IDialect dialect) {
|
||||
String sql = buildSql(queryTables, dialect);
|
||||
if (StringUtil.isNotBlank(alias)) {
|
||||
if (StringUtil.hasText(alias)) {
|
||||
return WrapperUtil.withAlias(sql, alias, dialect);
|
||||
}
|
||||
return sql;
|
||||
|
||||
@ -36,7 +36,7 @@ public class CaseSearchQueryColumn extends QueryColumn implements HasParamsColum
|
||||
@Override
|
||||
protected String toSelectSql(List<QueryTable> queryTables, IDialect dialect) {
|
||||
String sql = buildSql(queryTables, dialect);
|
||||
if (StringUtil.isNotBlank(alias)) {
|
||||
if (StringUtil.hasText(alias)) {
|
||||
return WrapperUtil.withAlias(sql, alias, dialect);
|
||||
}
|
||||
return sql;
|
||||
|
||||
@ -92,7 +92,7 @@ public class FunctionQueryColumn extends QueryColumn implements HasParamsColumn
|
||||
@Override
|
||||
public String toSelectSql(List<QueryTable> queryTables, IDialect dialect) {
|
||||
String sql = getSql(queryTables, dialect);
|
||||
if (StringUtil.isBlank(alias)) {
|
||||
if (StringUtil.noText(alias)) {
|
||||
return fnName + WrapperUtil.withBracket(sql);
|
||||
}
|
||||
return fnName + WrapperUtil.withAlias(sql, alias, dialect);
|
||||
@ -125,7 +125,7 @@ public class FunctionQueryColumn extends QueryColumn implements HasParamsColumn
|
||||
.map(c -> c.toSelectSql(queryTables, dialect))
|
||||
.collect(Collectors.joining(SqlConsts.DELIMITER));
|
||||
|
||||
if (StringUtil.isBlank(sql)) {
|
||||
if (StringUtil.noText(sql)) {
|
||||
return SqlConsts.EMPTY;
|
||||
}
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@ public class If {
|
||||
* 查看某个 string 对象是否有文本内容
|
||||
*/
|
||||
public static boolean hasText(String string) {
|
||||
return StringUtil.isNotBlank(string);
|
||||
return StringUtil.hasText(string);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ public class OperatorQueryCondition extends QueryCondition {
|
||||
//检测是否生效
|
||||
if (checkEffective()) {
|
||||
String childSql = childCondition.toSql(queryTables, dialect);
|
||||
if (StringUtil.isNotBlank(childSql)) {
|
||||
if (StringUtil.hasText(childSql)) {
|
||||
QueryCondition prevEffectiveCondition = getPrevEffectiveCondition();
|
||||
if (prevEffectiveCondition != null && this.connector != null) {
|
||||
sql.append(this.connector);
|
||||
|
||||
@ -49,7 +49,7 @@ public class OperatorSelectCondition extends QueryCondition {
|
||||
//检测是否生效
|
||||
if (checkEffective()) {
|
||||
String childSql = dialect.buildSelectSql(queryWrapper);
|
||||
if (StringUtil.isNotBlank(childSql)) {
|
||||
if (StringUtil.hasText(childSql)) {
|
||||
QueryCondition prevEffectiveCondition = getPrevEffectiveCondition();
|
||||
if (prevEffectiveCondition != null && this.connector != null) {
|
||||
sql.append(this.connector);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -73,7 +73,7 @@ public class QueryTable implements CloneSupport<QueryTable> {
|
||||
}
|
||||
|
||||
public String getNameWithSchema() {
|
||||
return StringUtil.isNotBlank(schema) ? schema + "." + name : name;
|
||||
return StringUtil.hasText(schema) ? schema + "." + name : name;
|
||||
}
|
||||
|
||||
public String getAlias() {
|
||||
@ -115,7 +115,7 @@ public class QueryTable implements CloneSupport<QueryTable> {
|
||||
|
||||
public String toSql(IDialect dialect, OperateType operateType) {
|
||||
String sql;
|
||||
if (StringUtil.isNotBlank(schema)) {
|
||||
if (StringUtil.hasText(schema)) {
|
||||
String table = dialect.getRealTable(name, operateType);
|
||||
sql = dialect.wrap(dialect.getRealSchema(schema, table, operateType)) + "." + dialect.wrap(table) + WrapperUtil.buildAlias(alias, dialect);
|
||||
} else {
|
||||
|
||||
@ -209,7 +209,7 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
|
||||
public QueryWrapper from(String... tables) {
|
||||
for (String table : tables) {
|
||||
if (StringUtil.isBlank(table)) {
|
||||
if (StringUtil.noText(table)) {
|
||||
throw new IllegalArgumentException("table must not be null or blank.");
|
||||
}
|
||||
from(new QueryTable(table));
|
||||
@ -801,7 +801,7 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
return this;
|
||||
}
|
||||
for (String queryOrderBy : orderBys) {
|
||||
if (StringUtil.isNotBlank(queryOrderBy)) {
|
||||
if (StringUtil.hasText(queryOrderBy)) {
|
||||
addOrderBy(new RawQueryOrderBy(queryOrderBy));
|
||||
}
|
||||
}
|
||||
@ -813,7 +813,7 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
return this;
|
||||
}
|
||||
for (String queryOrderBy : rawOrderBy) {
|
||||
if (StringUtil.isNotBlank(queryOrderBy)) {
|
||||
if (StringUtil.hasText(queryOrderBy)) {
|
||||
addOrderBy(new RawQueryOrderBy(queryOrderBy, false));
|
||||
}
|
||||
}
|
||||
@ -888,7 +888,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public QueryWrapper eq(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).eq(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).eq_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -900,7 +902,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T> QueryWrapper eq(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).eq(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).eq_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -912,7 +916,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <V> QueryWrapper eq(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).eq(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).eq_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -924,7 +930,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T, V> QueryWrapper eq(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).eq(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).eq_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -959,7 +967,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public QueryWrapper ne(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).ne(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).ne_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -971,7 +981,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T> QueryWrapper ne(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).ne(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).ne_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -983,7 +995,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <V> QueryWrapper ne(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).ne(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).ne_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -995,7 +1009,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T, V> QueryWrapper ne(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).ne(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).ne_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1030,7 +1046,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public QueryWrapper gt(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).gt(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).gt_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1042,7 +1060,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T> QueryWrapper gt(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).gt(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).gt_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1054,7 +1074,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <V> QueryWrapper gt(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).gt(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).gt_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1066,7 +1088,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T, V> QueryWrapper gt(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).gt(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).gt_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1101,7 +1125,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public QueryWrapper ge(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).ge(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).ge_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1113,7 +1139,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T> QueryWrapper ge(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).ge(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).ge_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1125,7 +1153,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <V> QueryWrapper ge(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).ge(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).ge_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1137,7 +1167,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T, V> QueryWrapper ge(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).ge(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).ge_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1172,7 +1204,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public QueryWrapper lt(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).lt(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).lt_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1184,7 +1218,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T> QueryWrapper lt(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).lt(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).lt_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1196,7 +1232,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <V> QueryWrapper lt(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).lt(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).lt_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1208,7 +1246,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T, V> QueryWrapper lt(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).lt(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).lt_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1243,7 +1283,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public QueryWrapper le(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).le(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).le_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1255,7 +1297,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T> QueryWrapper le(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).le(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).le_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1267,7 +1311,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <V> QueryWrapper le(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).le(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).le_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1279,7 +1325,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T, V> QueryWrapper le(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).le(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).le_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1361,7 +1409,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param values 条件的值
|
||||
*/
|
||||
public QueryWrapper in(String column, Object[] values, boolean isEffective) {
|
||||
and(QueryMethods.column(column).in(values, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).in_(values));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1372,7 +1422,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param values 值
|
||||
*/
|
||||
public <T> QueryWrapper in(LambdaGetter<T> column, Object[] values, boolean isEffective) {
|
||||
and(QueryMethods.column(column).in(values, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).in_(values));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1384,7 +1436,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param values 条件的值
|
||||
*/
|
||||
public QueryWrapper in(String column, Collection<?> values, boolean isEffective) {
|
||||
and(QueryMethods.column(column).in(values, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).in_(values));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1395,7 +1449,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param values 值
|
||||
*/
|
||||
public <T> QueryWrapper in(LambdaGetter<T> column, Collection<?> values, boolean isEffective) {
|
||||
and(QueryMethods.column(column).in(values, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).in_(values));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1407,7 +1463,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param queryWrapper 条件的值
|
||||
*/
|
||||
public QueryWrapper in(String column, QueryWrapper queryWrapper, boolean isEffective) {
|
||||
and(QueryMethods.column(column).in(queryWrapper, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).in_(queryWrapper));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1419,7 +1477,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param queryWrapper 值
|
||||
*/
|
||||
public <T> QueryWrapper in(LambdaGetter<T> column, QueryWrapper queryWrapper, boolean isEffective) {
|
||||
and(QueryMethods.column(column).in(queryWrapper, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).in_(queryWrapper));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1431,7 +1491,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param queryWrapper 条件的值
|
||||
*/
|
||||
public QueryWrapper in(String column, QueryWrapper queryWrapper, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).in(queryWrapper, isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).in_(queryWrapper));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1443,7 +1505,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param queryWrapper 值
|
||||
*/
|
||||
public <T> QueryWrapper in(LambdaGetter<T> column, QueryWrapper queryWrapper, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).in(queryWrapper, isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).in_(queryWrapper));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1525,7 +1589,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param values 条件的值
|
||||
*/
|
||||
public QueryWrapper notIn(String column, Object[] values, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notIn(values, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notIn_(values));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1536,7 +1602,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param values 值
|
||||
*/
|
||||
public <T> QueryWrapper notIn(LambdaGetter<T> column, Object[] values, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notIn(values, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notIn_(values));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1548,7 +1616,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param values 条件的值
|
||||
*/
|
||||
public QueryWrapper notIn(String column, Collection<?> values, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notIn(values, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notIn_(values));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1559,7 +1629,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param values 值
|
||||
*/
|
||||
public <T> QueryWrapper notIn(LambdaGetter<T> column, Collection<?> values, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notIn(values, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notIn_(values));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1571,7 +1643,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param queryWrapper 条件的值
|
||||
*/
|
||||
public QueryWrapper notIn(String column, QueryWrapper queryWrapper, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notIn(queryWrapper, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notIn_(queryWrapper));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1583,7 +1657,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param queryWrapper 值
|
||||
*/
|
||||
public <T> QueryWrapper notIn(LambdaGetter<T> column, QueryWrapper queryWrapper, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notIn(queryWrapper, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notIn_(queryWrapper));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1595,7 +1671,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param queryWrapper 条件的值
|
||||
*/
|
||||
public QueryWrapper notIn(String column, QueryWrapper queryWrapper, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).notIn(queryWrapper, isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).notIn_(queryWrapper));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1607,7 +1685,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param queryWrapper 值
|
||||
*/
|
||||
public <T> QueryWrapper notIn(LambdaGetter<T> column, QueryWrapper queryWrapper, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).notIn(queryWrapper, isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).notIn_(queryWrapper));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1644,7 +1724,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param end 结束的值
|
||||
*/
|
||||
public QueryWrapper between(String column, Object start, Object end, boolean isEffective) {
|
||||
and(QueryMethods.column(column).between(start, end, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).between_(start, end));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1656,7 +1738,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param end 结束的值
|
||||
*/
|
||||
public <T> QueryWrapper between(LambdaGetter<T> column, Object start, Object end, boolean isEffective) {
|
||||
and(QueryMethods.column(column).between(start, end, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).between_(start, end));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1669,7 +1753,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param end 结束的值
|
||||
*/
|
||||
public QueryWrapper between(String column, Object start, Object end, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).between(start, end, isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).between_(start, end));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1681,7 +1767,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param end 结束的值
|
||||
*/
|
||||
public <T> QueryWrapper between(LambdaGetter<T> column, Object start, Object end, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).between(start, end, isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).between_(start, end));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1718,7 +1806,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param end 结束的值
|
||||
*/
|
||||
public QueryWrapper notBetween(String column, Object start, Object end, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notBetween(start, end, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notBetween_(start, end));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1730,7 +1820,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param end 结束的值
|
||||
*/
|
||||
public <T> QueryWrapper notBetween(LambdaGetter<T> column, Object start, Object end, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notBetween(start, end, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notBetween_(start, end));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1743,7 +1835,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param end 结束的值
|
||||
*/
|
||||
public QueryWrapper notBetween(String column, Object start, Object end, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).notBetween(start, end, isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).notBetween_(start, end));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1755,7 +1849,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param end 结束的值
|
||||
*/
|
||||
public <T> QueryWrapper notBetween(LambdaGetter<T> column, Object start, Object end, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).notBetween(start, end, isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).notBetween_(start, end));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1790,7 +1886,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public QueryWrapper like(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).like(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).like_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1802,7 +1900,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T> QueryWrapper like(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).like(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).like_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1814,7 +1914,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <V> QueryWrapper like(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).like(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).like_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1826,7 +1928,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T, V> QueryWrapper like(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).like(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).like_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1861,7 +1965,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public QueryWrapper likeLeft(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).likeLeft(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).likeLeft_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1873,7 +1979,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T> QueryWrapper likeLeft(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).likeLeft(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).likeLeft_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1885,7 +1993,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <V> QueryWrapper likeLeft(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).likeLeft(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).likeLeft_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1897,7 +2007,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T, V> QueryWrapper likeLeft(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).likeLeft(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).likeLeft_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1932,7 +2044,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public QueryWrapper likeRight(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).likeRight(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).likeRight_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1944,7 +2058,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T> QueryWrapper likeRight(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).likeRight(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).likeRight_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1956,7 +2072,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <V> QueryWrapper likeRight(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).likeRight(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).likeRight_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1968,7 +2086,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T, V> QueryWrapper likeRight(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).likeRight(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).likeRight_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -2003,7 +2123,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public QueryWrapper notLike(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notLike(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notLike_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -2015,7 +2137,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T> QueryWrapper notLike(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notLike(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notLike_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -2027,7 +2151,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <V> QueryWrapper notLike(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).notLike(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).notLike_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -2039,7 +2165,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T, V> QueryWrapper notLike(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).notLike(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).notLike_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -2074,7 +2202,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public QueryWrapper notLikeLeft(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notLikeLeft(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notLikeLeft_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -2086,7 +2216,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T> QueryWrapper notLikeLeft(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notLikeLeft(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notLikeLeft_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -2098,7 +2230,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <V> QueryWrapper notLikeLeft(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).notLikeLeft(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).notLikeLeft_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -2110,7 +2244,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T, V> QueryWrapper notLikeLeft(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).notLikeLeft(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).notLikeLeft_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -2145,7 +2281,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public QueryWrapper notLikeRight(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notLikeRight(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notLikeRight_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -2157,7 +2295,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T> QueryWrapper notLikeRight(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notLikeRight(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notLikeRight_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -2169,7 +2309,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <V> QueryWrapper notLikeRight(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).notLikeRight(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).notLikeRight_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -2181,7 +2323,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T, V> QueryWrapper notLikeRight(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).notLikeRight(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).notLikeRight_(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -2213,7 +2357,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public QueryWrapper isNull(String column, boolean isEffective) {
|
||||
and(QueryMethods.column(column).isNull(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).isNull());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -2224,7 +2370,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T> QueryWrapper isNull(LambdaGetter<T> column, boolean isEffective) {
|
||||
and(QueryMethods.column(column).isNull(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).isNull());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -2235,7 +2383,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public QueryWrapper isNull(String column, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).isNull(isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).isNull());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -2246,7 +2396,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T> QueryWrapper isNull(LambdaGetter<T> column, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).isNull(isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).isNull());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -2278,7 +2430,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public QueryWrapper isNotNull(String column, boolean isEffective) {
|
||||
and(QueryMethods.column(column).isNotNull(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).isNotNull());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -2289,7 +2443,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T> QueryWrapper isNotNull(LambdaGetter<T> column, boolean isEffective) {
|
||||
and(QueryMethods.column(column).isNotNull(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).isNotNull());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -2300,7 +2456,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public QueryWrapper isNotNull(String column, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).isNotNull(isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).isNotNull());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -2311,7 +2469,9 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
||||
* @param isEffective 是否有效
|
||||
*/
|
||||
public <T> QueryWrapper isNotNull(LambdaGetter<T> column, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).isNotNull(isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).isNotNull());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@ -637,7 +637,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R eq(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).eq(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).eq_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -650,7 +652,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R eq(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).eq(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).eq_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -663,7 +667,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <V> R eq(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).eq(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).eq_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -676,7 +682,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T, V> R eq(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).eq(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).eq_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -714,7 +722,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R ne(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).ne(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).ne_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -727,7 +737,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R ne(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).ne(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).ne_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -740,7 +752,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <V> R ne(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).ne(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).ne_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -753,7 +767,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T, V> R ne(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).ne(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).ne_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -791,7 +807,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R gt(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).gt(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).gt_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -804,7 +822,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R gt(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).gt(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).gt_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -817,7 +837,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <V> R gt(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).gt(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).gt_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -830,7 +852,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T, V> R gt(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).gt(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).gt_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -843,7 +867,7 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R ge(String column, Object value) {
|
||||
and(QueryMethods.column(column).ge(value));
|
||||
and(QueryMethods.column(column).ge_(value));
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -855,7 +879,7 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R ge(LambdaGetter<T> column, Object value) {
|
||||
and(QueryMethods.column(column).ge(value));
|
||||
and(QueryMethods.column(column).ge_(value));
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -868,7 +892,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R ge(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).ge(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).ge_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -881,7 +907,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R ge(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).ge(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).ge_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -894,7 +922,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <V> R ge(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).ge(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).ge_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -907,7 +937,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T, V> R ge(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).ge(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).ge_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -945,7 +977,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R lt(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).lt(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).lt_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -958,7 +992,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R lt(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).lt(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).lt_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -971,7 +1007,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <V> R lt(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).lt(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).lt_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -984,7 +1022,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T, V> R lt(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).lt(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).lt_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1022,7 +1062,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R le(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).le(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).le_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1035,7 +1077,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R le(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).le(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).le_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1048,7 +1092,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <V> R le(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).le(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).le_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1061,7 +1107,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T, V> R le(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).le(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).le_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1074,7 +1122,7 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R in(String column, Object... values) {
|
||||
and(QueryMethods.column(column).in(values));
|
||||
and(QueryMethods.column(column).in(values, true));
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1086,7 +1134,7 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R in(LambdaGetter<T> column, Object... values) {
|
||||
and(QueryMethods.column(column).in(values));
|
||||
and(QueryMethods.column(column).in(values, true));
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1150,7 +1198,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R in(String column, Object[] values, boolean isEffective) {
|
||||
and(QueryMethods.column(column).in(values, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).in(values, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1162,7 +1212,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R in(LambdaGetter<T> column, Object[] values, boolean isEffective) {
|
||||
and(QueryMethods.column(column).in(values, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).in(values, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1175,7 +1227,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R in(String column, Collection<?> values, boolean isEffective) {
|
||||
and(QueryMethods.column(column).in(values, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).in(values, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1187,7 +1241,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R in(LambdaGetter<T> column, Collection<?> values, boolean isEffective) {
|
||||
and(QueryMethods.column(column).in(values, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).in(values, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1200,7 +1256,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R in(String column, QueryWrapper queryWrapper, boolean isEffective) {
|
||||
and(QueryMethods.column(column).in(queryWrapper, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).in(queryWrapper, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1213,7 +1271,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R in(LambdaGetter<T> column, QueryWrapper queryWrapper, boolean isEffective) {
|
||||
and(QueryMethods.column(column).in(queryWrapper, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).in(queryWrapper, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1226,7 +1286,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R in(String column, QueryWrapper queryWrapper, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).in(queryWrapper, isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).in(queryWrapper, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1239,7 +1301,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R in(LambdaGetter<T> column, QueryWrapper queryWrapper, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).in(queryWrapper, isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).in(queryWrapper, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1328,7 +1392,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R notIn(String column, Object[] values, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notIn(values, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notIn(values, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1340,7 +1406,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R notIn(LambdaGetter<T> column, Object[] values, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notIn(values, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notIn(values, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1353,7 +1421,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R notIn(String column, Collection<?> values, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notIn(values, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notIn(values, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1365,7 +1435,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R notIn(LambdaGetter<T> column, Collection<?> values, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notIn(values, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notIn(values, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1378,7 +1450,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R notIn(String column, QueryWrapper queryWrapper, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notIn(queryWrapper, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notIn(queryWrapper, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1391,7 +1465,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R notIn(LambdaGetter<T> column, QueryWrapper queryWrapper, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notIn(queryWrapper, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notIn(queryWrapper, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1404,7 +1480,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R notIn(String column, QueryWrapper queryWrapper, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).notIn(queryWrapper, isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).notIn(queryWrapper, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1417,7 +1495,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R notIn(LambdaGetter<T> column, QueryWrapper queryWrapper, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).notIn(queryWrapper, isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).notIn(queryWrapper, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1457,7 +1537,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R between(String column, Object start, Object end, boolean isEffective) {
|
||||
and(QueryMethods.column(column).between(start, end, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).between(start, end, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1470,7 +1552,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R between(LambdaGetter<T> column, Object start, Object end, boolean isEffective) {
|
||||
and(QueryMethods.column(column).between(start, end, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).between(start, end, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1484,7 +1568,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R between(String column, Object start, Object end, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).between(start, end, isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).between(start, end, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1497,7 +1583,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R between(LambdaGetter<T> column, Object start, Object end, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).between(start, end, isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).between(start, end, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1537,7 +1625,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R notBetween(String column, Object start, Object end, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notBetween(start, end, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notBetween(start, end, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1550,7 +1640,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R notBetween(LambdaGetter<T> column, Object start, Object end, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notBetween(start, end, isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notBetween(start, end, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1564,7 +1656,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R notBetween(String column, Object start, Object end, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).notBetween(start, end, isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).notBetween(start, end, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1577,7 +1671,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R notBetween(LambdaGetter<T> column, Object start, Object end, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).notBetween(start, end, isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).notBetween(start, end, true));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1615,7 +1711,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R like(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).like(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).like_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1628,7 +1726,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R like(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).like(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).like_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1641,7 +1741,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <V> R like(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).like(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).like_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1654,7 +1756,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T, V> R like(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).like(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).like_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1692,7 +1796,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R likeLeft(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).likeLeft(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).likeLeft_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1705,7 +1811,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R likeLeft(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).likeLeft(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).likeLeft_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1718,7 +1826,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <V> R likeLeft(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).likeLeft(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).likeLeft_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1731,7 +1841,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T, V> R likeLeft(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).likeLeft(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).likeLeft_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1769,7 +1881,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R likeRight(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).likeRight(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).likeRight_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1782,7 +1896,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R likeRight(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).likeRight(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).likeRight_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1795,7 +1911,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <V> R likeRight(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).likeRight(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).likeRight_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1808,7 +1926,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T, V> R likeRight(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).likeRight(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).likeRight_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1846,7 +1966,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R notLike(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notLike(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notLike_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1859,7 +1981,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R notLike(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notLike(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notLike_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1872,7 +1996,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <V> R notLike(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).notLike(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).notLike_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1885,7 +2011,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T, V> R notLike(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).notLike(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).notLike_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1923,7 +2051,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R notLikeLeft(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notLikeLeft(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notLikeLeft_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1936,7 +2066,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R notLikeLeft(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notLikeLeft(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notLikeLeft_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1949,7 +2081,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <V> R notLikeLeft(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).notLikeLeft(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).notLikeLeft_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -1962,7 +2096,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T, V> R notLikeLeft(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).notLikeLeft(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).notLikeLeft_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -2000,7 +2136,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R notLikeRight(String column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notLikeRight(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notLikeRight_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -2013,7 +2151,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R notLikeRight(LambdaGetter<T> column, Object value, boolean isEffective) {
|
||||
and(QueryMethods.column(column).notLikeRight(value).when(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).notLikeRight_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -2026,7 +2166,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <V> R notLikeRight(String column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).notLikeRight(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).notLikeRight_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -2039,7 +2181,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T, V> R notLikeRight(LambdaGetter<T> column, V value, Predicate<V> isEffective) {
|
||||
and(QueryMethods.column(column).notLikeRight(value, isEffective));
|
||||
if (isEffective.test(value)) {
|
||||
and(QueryMethods.column(column).notLikeRight_(value));
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -2074,7 +2218,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R isNull(String column, boolean isEffective) {
|
||||
and(QueryMethods.column(column).isNull(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).isNull());
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -2086,7 +2232,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R isNull(LambdaGetter<T> column, boolean isEffective) {
|
||||
and(QueryMethods.column(column).isNull(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).isNull());
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -2098,7 +2246,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R isNull(String column, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).isNull(isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).isNull());
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -2110,7 +2260,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R isNull(LambdaGetter<T> column, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).isNull(isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).isNull());
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -2145,7 +2297,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R isNotNull(String column, boolean isEffective) {
|
||||
and(QueryMethods.column(column).isNotNull(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).isNotNull());
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -2157,7 +2311,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R isNotNull(LambdaGetter<T> column, boolean isEffective) {
|
||||
and(QueryMethods.column(column).isNotNull(isEffective));
|
||||
if (isEffective) {
|
||||
and(QueryMethods.column(column).isNotNull());
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -2169,7 +2325,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public R isNotNull(String column, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).isNotNull(isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).isNotNull());
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
@ -2181,7 +2339,9 @@ public class QueryWrapperAdapter<R extends QueryWrapperAdapter<R>> extends Query
|
||||
*/
|
||||
@Override
|
||||
public <T> R isNotNull(LambdaGetter<T> column, BooleanSupplier isEffective) {
|
||||
and(QueryMethods.column(column).isNotNull(isEffective));
|
||||
if (isEffective.getAsBoolean()) {
|
||||
and(QueryMethods.column(column).isNotNull());
|
||||
}
|
||||
return (R) this;
|
||||
}
|
||||
|
||||
|
||||
@ -47,8 +47,8 @@ public class RawQueryTable extends QueryTable {
|
||||
return false;
|
||||
}
|
||||
// 只比较别名,不比较内容
|
||||
if (StringUtil.isNotBlank(alias)
|
||||
&& StringUtil.isNotBlank(table.alias)) {
|
||||
if (StringUtil.hasText(alias)
|
||||
&& StringUtil.hasText(table.alias)) {
|
||||
return Objects.equals(alias, table.alias);
|
||||
}
|
||||
return false;
|
||||
|
||||
@ -47,7 +47,7 @@ public class SelectQueryColumn extends QueryColumn implements HasParamsColumn {
|
||||
@Override
|
||||
protected String toSelectSql(List<QueryTable> queryTables, IDialect dialect) {
|
||||
String selectSql = dialect.forSelectByQuery(queryWrapper);
|
||||
if (StringUtil.isNotBlank(selectSql) && StringUtil.isNotBlank(alias)) {
|
||||
if (StringUtil.hasText(selectSql) && StringUtil.hasText(alias)) {
|
||||
selectSql = WrapperUtil.withAlias(selectSql, alias, dialect);
|
||||
}
|
||||
return selectSql;
|
||||
|
||||
@ -49,7 +49,7 @@ public class SelectQueryTable extends QueryTable {
|
||||
@Override
|
||||
public String toSql(IDialect dialect, OperateType operateType) {
|
||||
String sql = dialect.buildSelectSql(queryWrapper);
|
||||
if (StringUtil.isNotBlank(alias)) {
|
||||
if (StringUtil.hasText(alias)) {
|
||||
return WrapperUtil.withAlias(sql, alias, dialect);
|
||||
} else {
|
||||
return WrapperUtil.withBracket(sql);
|
||||
|
||||
@ -59,10 +59,10 @@ public class StringFunctionQueryColumn extends QueryColumn {
|
||||
@Override
|
||||
public String toSelectSql(List<QueryTable> queryTables, IDialect dialect) {
|
||||
String sql = StringUtil.join(SqlConsts.DELIMITER, params);
|
||||
if (StringUtil.isBlank(sql)) {
|
||||
if (StringUtil.noText(sql)) {
|
||||
return SqlConsts.EMPTY;
|
||||
}
|
||||
if (StringUtil.isBlank(alias)) {
|
||||
if (StringUtil.noText(alias)) {
|
||||
return fnName + WrapperUtil.withBracket(sql);
|
||||
}
|
||||
return fnName + WrapperUtil.withAlias(sql, alias, dialect);
|
||||
@ -71,7 +71,7 @@ public class StringFunctionQueryColumn extends QueryColumn {
|
||||
@Override
|
||||
protected String toConditionSql(List<QueryTable> queryTables, IDialect dialect) {
|
||||
String sql = StringUtil.join(SqlConsts.DELIMITER, params);
|
||||
if (StringUtil.isBlank(sql)) {
|
||||
if (StringUtil.noText(sql)) {
|
||||
return SqlConsts.EMPTY;
|
||||
}
|
||||
return fnName + WrapperUtil.withBracket(sql);
|
||||
|
||||
@ -170,11 +170,11 @@ class WrapperUtil {
|
||||
}
|
||||
|
||||
static String buildAlias(String alias, IDialect dialect) {
|
||||
return StringUtil.isBlank(alias) ? SqlConsts.EMPTY : getAsKeyWord(dialect) + dialect.wrap(alias);
|
||||
return StringUtil.noText(alias) ? SqlConsts.EMPTY : getAsKeyWord(dialect) + dialect.wrap(alias);
|
||||
}
|
||||
|
||||
static String buildColumnAlias(String alias, IDialect dialect) {
|
||||
return StringUtil.isBlank(alias) ? SqlConsts.EMPTY : getAsKeyWord(dialect) + dialect.wrapColumnAlias(alias);
|
||||
return StringUtil.noText(alias) ? SqlConsts.EMPTY : getAsKeyWord(dialect) + dialect.wrapColumnAlias(alias);
|
||||
}
|
||||
|
||||
private static String getAsKeyWord(IDialect dialect) {
|
||||
|
||||
@ -87,12 +87,12 @@ public abstract class AbstractRelation<SelfEntity> {
|
||||
this.selfFieldWrapper = FieldWrapper.of(entityClass, selfField);
|
||||
|
||||
//以使用者注解配置为主
|
||||
this.targetTableInfo = StringUtil.isBlank(targetTable) ? TableInfoFactory.ofEntityClass(relationFieldWrapper.getMappingType()) : TableInfoFactory.ofTableName(targetTable);
|
||||
this.targetTableInfo = StringUtil.noText(targetTable) ? TableInfoFactory.ofEntityClass(relationFieldWrapper.getMappingType()) : TableInfoFactory.ofTableName(targetTable);
|
||||
this.targetSchema = targetTableInfo != null ? targetTableInfo.getSchema() : targetSchema;
|
||||
this.targetTable = targetTableInfo != null ? targetTableInfo.getTableName() : targetTable;
|
||||
|
||||
//当指定了 valueField 的时候,一般是 String Integer 等基本数据类型
|
||||
this.targetEntityClass = (StringUtil.isNotBlank(valueField) && targetTableInfo != null) ? targetTableInfo.getEntityClass() : relationFieldWrapper.getMappingType();
|
||||
this.targetEntityClass = (StringUtil.hasText(valueField) && targetTableInfo != null) ? targetTableInfo.getEntityClass() : relationFieldWrapper.getMappingType();
|
||||
|
||||
this.targetField = ClassUtil.getFirstField(targetEntityClass, field -> field.getName().equalsIgnoreCase(targetField));
|
||||
if (this.targetField == null) {
|
||||
@ -102,7 +102,7 @@ public abstract class AbstractRelation<SelfEntity> {
|
||||
this.targetFieldWrapper = FieldWrapper.of(targetEntityClass, targetField);
|
||||
|
||||
this.valueField = valueField;
|
||||
this.onlyQueryValueField = StringUtil.isNotBlank(valueField);
|
||||
this.onlyQueryValueField = StringUtil.hasText(valueField);
|
||||
|
||||
this.conditionColumn = targetTableInfo == null ? column(targetTable, StringUtil.camelToUnderline(this.targetField.getName()))
|
||||
: column(targetTable, targetTableInfo.getColumnByProperty(this.targetField.getName()));
|
||||
@ -126,7 +126,7 @@ public abstract class AbstractRelation<SelfEntity> {
|
||||
}
|
||||
|
||||
protected void initExtraCondition(String extraCondition) {
|
||||
if (StringUtil.isBlank(extraCondition)) {
|
||||
if (StringUtil.noText(extraCondition)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -336,15 +336,15 @@ public abstract class AbstractRelation<SelfEntity> {
|
||||
}
|
||||
|
||||
public String getTargetTableWithSchema() {
|
||||
if (StringUtil.isNotBlank(targetTable)) {
|
||||
return StringUtil.isNotBlank(targetSchema) ? targetSchema + "." + targetTable : targetTable;
|
||||
if (StringUtil.hasText(targetTable)) {
|
||||
return StringUtil.hasText(targetSchema) ? targetSchema + "." + targetTable : targetTable;
|
||||
} else {
|
||||
return targetTableInfo.getTableNameWithSchema();
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isRelationByMiddleTable() {
|
||||
return StringUtil.isNotBlank(joinTable);
|
||||
return StringUtil.hasText(joinTable);
|
||||
}
|
||||
|
||||
|
||||
@ -353,7 +353,7 @@ public abstract class AbstractRelation<SelfEntity> {
|
||||
}
|
||||
|
||||
protected static String getDefaultPrimaryProperty(String key, Class<?> entityClass, String message) {
|
||||
if (StringUtil.isNotBlank(key)) {
|
||||
if (StringUtil.hasText(key)) {
|
||||
return key;
|
||||
}
|
||||
|
||||
@ -388,7 +388,7 @@ public abstract class AbstractRelation<SelfEntity> {
|
||||
queryWrapper.where(conditionColumn.eq(targetValues.iterator().next()));
|
||||
}
|
||||
|
||||
if (StringUtil.isNotBlank(extraConditionSql)) {
|
||||
if (StringUtil.hasText(extraConditionSql)) {
|
||||
queryWrapper.and(extraConditionSql, RelationManager.getExtraConditionParams(extraConditionParamKeys));
|
||||
}
|
||||
|
||||
|
||||
@ -328,12 +328,12 @@ public class RelationManager {
|
||||
|
||||
//注解配置的数据源
|
||||
String configDsKey = relation.getDataSource();
|
||||
if (StringUtil.isBlank(configDsKey) && currentDsKey != null) {
|
||||
if (StringUtil.noText(configDsKey) && currentDsKey != null) {
|
||||
configDsKey = currentDsKey;
|
||||
}
|
||||
|
||||
try {
|
||||
if (StringUtil.isNotBlank(configDsKey)) {
|
||||
if (StringUtil.hasText(configDsKey)) {
|
||||
DataSourceKey.use(configDsKey);
|
||||
}
|
||||
|
||||
@ -391,7 +391,7 @@ public class RelationManager {
|
||||
relation.join(entities, targetObjectList, mappingRows);
|
||||
}
|
||||
} finally {
|
||||
if (StringUtil.isNotBlank(configDsKey)) {
|
||||
if (StringUtil.hasText(configDsKey)) {
|
||||
DataSourceKey.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,7 +22,6 @@ import com.mybatisflex.core.util.*;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class ToManyRelation<SelfEntity> extends AbstractRelation<SelfEntity> {
|
||||
|
||||
@ -64,7 +63,7 @@ public class ToManyRelation<SelfEntity> extends AbstractRelation<SelfEntity> {
|
||||
*/
|
||||
@Override
|
||||
public QueryWrapper buildQueryWrapper(Set<Object> targetValues) {
|
||||
if (StringUtil.isNotBlank(selfValueSplitBy) && CollectionUtil.isNotEmpty(targetValues)) {
|
||||
if (StringUtil.hasText(selfValueSplitBy) && CollectionUtil.isNotEmpty(targetValues)) {
|
||||
Set<Object> newTargetValues = new HashSet<>();
|
||||
for (Object targetValue : targetValues) {
|
||||
if (targetValue == null) {
|
||||
@ -86,7 +85,7 @@ public class ToManyRelation<SelfEntity> extends AbstractRelation<SelfEntity> {
|
||||
|
||||
@Override
|
||||
public void customizeQueryWrapper(QueryWrapper queryWrapper) {
|
||||
if (StringUtil.isNotBlank(orderBy)) {
|
||||
if (StringUtil.hasText(orderBy)) {
|
||||
queryWrapper.orderBy(orderBy);
|
||||
}
|
||||
|
||||
@ -135,7 +134,7 @@ public class ToManyRelation<SelfEntity> extends AbstractRelation<SelfEntity> {
|
||||
Class<?> fieldType = relationFieldWrapper.getFieldType();
|
||||
boolean isMapType = Map.class.isAssignableFrom(fieldType);
|
||||
Class<?> wrapType = isMapType ? getMapWrapType(fieldType) : MapperUtil.getCollectionWrapType(fieldType);
|
||||
boolean splitMode = StringUtil.isNotBlank(selfValueSplitBy);
|
||||
boolean splitMode = StringUtil.hasText(selfValueSplitBy);
|
||||
|
||||
for (SelfEntity selfEntity : selfEntities) {
|
||||
if (selfEntity == null) {
|
||||
@ -230,7 +229,7 @@ public class ToManyRelation<SelfEntity> extends AbstractRelation<SelfEntity> {
|
||||
|
||||
public void setMapKeyField(String mapKeyField) {
|
||||
this.mapKeyField = mapKeyField;
|
||||
if (StringUtil.isNotBlank(mapKeyField)) {
|
||||
if (StringUtil.hasText(mapKeyField)) {
|
||||
this.mapKeyFieldWrapper = FieldWrapper.of(targetEntityClass, mapKeyField);
|
||||
} else {
|
||||
if (Map.class.isAssignableFrom(relationFieldWrapper.getFieldType())) {
|
||||
|
||||
@ -116,7 +116,7 @@ public class Row extends LinkedHashMap<String, Object> implements UpdateWrapper<
|
||||
return this;
|
||||
}
|
||||
|
||||
if (StringUtil.isBlank(property)) {
|
||||
if (StringUtil.noText(property)) {
|
||||
throw new IllegalArgumentException("key column not be null or empty.");
|
||||
}
|
||||
|
||||
|
||||
@ -144,7 +144,7 @@ public class ColumnInfo {
|
||||
}
|
||||
|
||||
//脱敏规则配置
|
||||
else if (StringUtil.isNotBlank(maskType)) {
|
||||
else if (StringUtil.hasText(maskType)) {
|
||||
if (typeHandler != null) {
|
||||
//noinspection unchecked
|
||||
buildTypeHandler = new CompositeMaskTypeHandler(maskType, (TypeHandler<Object>) typeHandler);
|
||||
|
||||
@ -65,7 +65,7 @@ public class IdInfo extends ColumnInfo {
|
||||
this.keyType = defaultKeyConfig.getKeyType();
|
||||
this.before = defaultKeyConfig.isBefore();
|
||||
}
|
||||
if (StringUtil.isBlank(this.value) && StringUtil.isNotBlank(defaultKeyConfig.getValue())) {
|
||||
if (StringUtil.noText(this.value) && StringUtil.hasText(defaultKeyConfig.getValue())) {
|
||||
this.value = defaultKeyConfig.getValue();
|
||||
}
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ public class TableInfo {
|
||||
}
|
||||
|
||||
public String getWrapSchemaAndTableName(IDialect dialect, OperateType operateType) {
|
||||
if (StringUtil.isNotBlank(schema)) {
|
||||
if (StringUtil.hasText(schema)) {
|
||||
String table = dialect.getRealTable(tableName, operateType);
|
||||
return dialect.wrap(dialect.getRealSchema(schema, table, operateType)) + "." + dialect.wrap(table);
|
||||
} else {
|
||||
@ -187,7 +187,7 @@ public class TableInfo {
|
||||
public void setTableName(String tableName) {
|
||||
int indexOf = tableName.indexOf(".");
|
||||
if (indexOf > 0) {
|
||||
if (StringUtil.isBlank(schema)) {
|
||||
if (StringUtil.noText(schema)) {
|
||||
this.schema = tableName.substring(0, indexOf);
|
||||
this.tableName = tableName.substring(indexOf + 1);
|
||||
} else {
|
||||
@ -380,7 +380,7 @@ public class TableInfo {
|
||||
}
|
||||
}
|
||||
}
|
||||
return StringUtil.isNotBlank(column) ? column : property;
|
||||
return StringUtil.hasText(column) ? column : property;
|
||||
}
|
||||
|
||||
public Map<String, Class<?>> getAssociationType() {
|
||||
@ -812,7 +812,7 @@ public class TableInfo {
|
||||
|
||||
|
||||
public Object[] buildTenantIdArgs() {
|
||||
if (StringUtil.isBlank(tenantIdColumn)) {
|
||||
if (StringUtil.noText(tenantIdColumn)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -889,7 +889,7 @@ public class TableInfo {
|
||||
}
|
||||
|
||||
// 添加乐观锁条件,只有在 update 的时候进行处理
|
||||
if (StringUtil.isNotBlank(getOptimisticLockColumnOrSkip()) && entity != null) {
|
||||
if (StringUtil.hasText(getOptimisticLockColumnOrSkip()) && entity != null) {
|
||||
Object versionValue = buildColumnSqlArg(entity, versionColumn);
|
||||
if (versionValue == null) {
|
||||
throw FlexExceptions.wrap(LocalizedFormats.ENTITY_VERSION_NULL, entity);
|
||||
@ -898,7 +898,7 @@ public class TableInfo {
|
||||
}
|
||||
|
||||
// 逻辑删除
|
||||
if (StringUtil.isNotBlank(getLogicDeleteColumnOrSkip())) {
|
||||
if (StringUtil.hasText(getLogicDeleteColumnOrSkip())) {
|
||||
// 逻辑删除时 保证前面的条件被括号包裹
|
||||
// fix:https://gitee.com/mybatis-flex/mybatis-flex/issues/I9163G
|
||||
QueryCondition whereCondition = CPI.getWhereQueryCondition(queryWrapper);
|
||||
@ -941,7 +941,7 @@ public class TableInfo {
|
||||
// join table
|
||||
else {
|
||||
String nameWithSchema = joinQueryTable.getNameWithSchema();
|
||||
if (StringUtil.isNotBlank(nameWithSchema)) {
|
||||
if (StringUtil.hasText(nameWithSchema)) {
|
||||
TableInfo tableInfo = TableInfoFactory.ofTableName(nameWithSchema);
|
||||
if (tableInfo != null) {
|
||||
QueryCondition joinQueryCondition = CPI.getJoinQueryCondition(join);
|
||||
@ -977,7 +977,7 @@ public class TableInfo {
|
||||
doAppendConditions(entity, childQuery);
|
||||
} else {
|
||||
String nameWithSchema = queryTable.getNameWithSchema();
|
||||
if (StringUtil.isNotBlank(nameWithSchema)) {
|
||||
if (StringUtil.hasText(nameWithSchema)) {
|
||||
TableInfo tableInfo = TableInfoFactory.ofTableName(nameWithSchema);
|
||||
if (tableInfo != null) {
|
||||
tableInfo.appendConditions(entity, queryWrapper);
|
||||
@ -1374,7 +1374,7 @@ public class TableInfo {
|
||||
* @param entityObject
|
||||
*/
|
||||
public void initVersionValueIfNecessary(Object entityObject) {
|
||||
if (StringUtil.isBlank(versionColumn)) {
|
||||
if (StringUtil.noText(versionColumn)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1393,7 +1393,7 @@ public class TableInfo {
|
||||
* @param entityObject
|
||||
*/
|
||||
public void initTenantIdIfNecessary(Object entityObject) {
|
||||
if (StringUtil.isBlank(tenantIdColumn)) {
|
||||
if (StringUtil.noText(tenantIdColumn)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1426,7 +1426,7 @@ public class TableInfo {
|
||||
* @param entityObject
|
||||
*/
|
||||
public void initLogicDeleteValueIfNecessary(Object entityObject) {
|
||||
if (StringUtil.isBlank(getLogicDeleteColumnOrSkip())) {
|
||||
if (StringUtil.noText(getLogicDeleteColumnOrSkip())) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -153,7 +153,7 @@ public class TableInfoFactory {
|
||||
|
||||
|
||||
public static TableInfo ofTableName(String tableName) {
|
||||
return StringUtil.isNotBlank(tableName) ? tableInfoMap.get(tableName) : null;
|
||||
return StringUtil.hasText(tableName) ? tableInfoMap.get(tableName) : null;
|
||||
}
|
||||
|
||||
|
||||
@ -289,7 +289,7 @@ public class TableInfoFactory {
|
||||
tableInfo.setOnSetListeners(setListeners);
|
||||
}
|
||||
|
||||
if (StringUtil.isNotBlank(table.dataSource())) {
|
||||
if (StringUtil.hasText(table.dataSource())) {
|
||||
tableInfo.setDataSource(table.dataSource());
|
||||
}
|
||||
}
|
||||
@ -412,12 +412,12 @@ public class TableInfoFactory {
|
||||
}
|
||||
|
||||
|
||||
if (columnAnnotation != null && StringUtil.isNotBlank(columnAnnotation.onInsertValue())) {
|
||||
if (columnAnnotation != null && StringUtil.hasText(columnAnnotation.onInsertValue())) {
|
||||
onInsertColumns.put(columnName, columnAnnotation.onInsertValue().trim());
|
||||
}
|
||||
|
||||
|
||||
if (columnAnnotation != null && StringUtil.isNotBlank(columnAnnotation.onUpdateValue())) {
|
||||
if (columnAnnotation != null && StringUtil.hasText(columnAnnotation.onUpdateValue())) {
|
||||
onUpdateColumns.put(columnName, columnAnnotation.onUpdateValue().trim());
|
||||
}
|
||||
|
||||
@ -499,7 +499,7 @@ public class TableInfoFactory {
|
||||
|
||||
// 数据脱敏配置
|
||||
ColumnMask columnMask = field.getAnnotation(ColumnMask.class);
|
||||
if (columnMask != null && StringUtil.isNotBlank(columnMask.value())) {
|
||||
if (columnMask != null && StringUtil.hasText(columnMask.value())) {
|
||||
if (String.class != fieldType) {
|
||||
throw new IllegalStateException("@ColumnMask() only support for string type field. error: " + entityClass.getName() + "." + field.getName());
|
||||
}
|
||||
@ -586,7 +586,7 @@ public class TableInfoFactory {
|
||||
|
||||
|
||||
static String getColumnName(boolean isCamelToUnderline, Field field, Column column) {
|
||||
if (column != null && StringUtil.isNotBlank(column.value())) {
|
||||
if (column != null && StringUtil.hasText(column.value())) {
|
||||
return column.value();
|
||||
}
|
||||
if (isCamelToUnderline) {
|
||||
|
||||
@ -84,7 +84,7 @@ public class TableManager {
|
||||
Map<String, String> mapping = tableNameMappingTL.get();
|
||||
if (mapping != null) {
|
||||
String dynamicTableName = mapping.get(tableName);
|
||||
if (StringUtil.isNotBlank(dynamicTableName)) {
|
||||
if (StringUtil.hasText(dynamicTableName)) {
|
||||
return dynamicTableName;
|
||||
}
|
||||
}
|
||||
@ -94,7 +94,7 @@ public class TableManager {
|
||||
}
|
||||
|
||||
String dynamicTableName = dynamicTableProcessor.process(tableName, operateType);
|
||||
return StringUtil.isNotBlank(dynamicTableName) ? dynamicTableName : tableName;
|
||||
return StringUtil.hasText(dynamicTableName) ? dynamicTableName : tableName;
|
||||
}
|
||||
|
||||
|
||||
@ -102,7 +102,7 @@ public class TableManager {
|
||||
Map<String, String> mapping = schemaMappingTL.get();
|
||||
if (mapping != null) {
|
||||
String dynamicSchema = mapping.get(schema);
|
||||
if (StringUtil.isNotBlank(dynamicSchema)) {
|
||||
if (StringUtil.hasText(dynamicSchema)) {
|
||||
return dynamicSchema;
|
||||
}
|
||||
}
|
||||
@ -112,7 +112,7 @@ public class TableManager {
|
||||
}
|
||||
|
||||
String dynamicSchema = dynamicSchemaProcessor.process(schema, table, operateType);
|
||||
return StringUtil.isNotBlank(dynamicSchema) ? dynamicSchema : schema;
|
||||
return StringUtil.hasText(dynamicSchema) ? dynamicSchema : schema;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ public class ConvertUtil {
|
||||
return getPrimitiveDefaultValue(targetClass);
|
||||
}
|
||||
if (value == null || (targetClass != String.class && value.getClass() == String.class
|
||||
&& StringUtil.isBlank((String) value))) {
|
||||
&& StringUtil.noText((String) value))) {
|
||||
return null;
|
||||
}
|
||||
if (value.getClass().isAssignableFrom(targetClass)) {
|
||||
|
||||
@ -93,7 +93,7 @@ public class DateUtil {
|
||||
|
||||
|
||||
public static Date parseDate(String dateString) {
|
||||
if (StringUtil.isBlank(dateString)) {
|
||||
if (StringUtil.noText(dateString)) {
|
||||
return null;
|
||||
}
|
||||
dateString = dateString.trim();
|
||||
@ -134,7 +134,7 @@ public class DateUtil {
|
||||
|
||||
|
||||
public static LocalDateTime parseLocalDateTime(String dateString) {
|
||||
if (StringUtil.isBlank(dateString)) {
|
||||
if (StringUtil.noText(dateString)) {
|
||||
return null;
|
||||
}
|
||||
dateString = dateString.trim();
|
||||
|
||||
@ -66,7 +66,7 @@ public class LambdaUtil {
|
||||
public static <T> String getAliasName(LambdaGetter<T> getter, boolean withPrefix) {
|
||||
QueryColumn queryColumn = getQueryColumn(getter);
|
||||
if (queryColumn != null) {
|
||||
String alias = StringUtil.isNotBlank(queryColumn.getAlias()) ? queryColumn.getAlias() : queryColumn.getName();
|
||||
String alias = StringUtil.hasText(queryColumn.getAlias()) ? queryColumn.getAlias() : queryColumn.getName();
|
||||
return withPrefix ? queryColumn.getTable().getName() + "$" + alias : alias;
|
||||
}
|
||||
return getFieldName(getter);
|
||||
|
||||
@ -29,7 +29,7 @@ public class MapUtil {
|
||||
int jvmVersion = -1;
|
||||
try {
|
||||
String javaSpecVer = StringUtil.tryTrim(System.getProperty("java.specification.version"));
|
||||
if (StringUtil.isNotBlank(javaSpecVer)) {
|
||||
if (StringUtil.hasText(javaSpecVer)) {
|
||||
if (javaSpecVer.startsWith("1.")) {
|
||||
javaSpecVer = javaSpecVer.substring(2);
|
||||
}
|
||||
|
||||
@ -168,7 +168,7 @@ public class MapperUtil {
|
||||
QueryTable joinQueryTable = CPI.getJoinQueryTable(join);
|
||||
if (joinQueryTable != null) {
|
||||
String tableName = joinQueryTable.getName();
|
||||
if (StringUtil.isNotBlank(joinQueryTable.getAlias())) {
|
||||
if (StringUtil.hasText(joinQueryTable.getAlias())) {
|
||||
joinTables.add(tableName + "." + joinQueryTable.getAlias());
|
||||
} else {
|
||||
joinTables.add(tableName);
|
||||
|
||||
@ -36,7 +36,7 @@ public class SqlUtil {
|
||||
}
|
||||
|
||||
public static void keepColumnSafely(String column) {
|
||||
if (StringUtil.isBlank(column)) {
|
||||
if (StringUtil.noText(column)) {
|
||||
throw new IllegalArgumentException("Column must not be empty");
|
||||
} else {
|
||||
column = column.trim();
|
||||
|
||||
@ -84,7 +84,7 @@ public class StringUtil {
|
||||
* @param string
|
||||
*/
|
||||
public static String camelToUnderline(String string) {
|
||||
if (isBlank(string)) {
|
||||
if (noText(string)) {
|
||||
return "";
|
||||
}
|
||||
int strLen = string.length();
|
||||
@ -108,7 +108,7 @@ public class StringUtil {
|
||||
* @param string
|
||||
*/
|
||||
public static String underlineToCamel(String string) {
|
||||
if (isBlank(string)) {
|
||||
if (noText(string)) {
|
||||
return "";
|
||||
}
|
||||
if (Character.isUpperCase(string.charAt(0))) {
|
||||
@ -134,7 +134,7 @@ public class StringUtil {
|
||||
* 删除字符串中的字符
|
||||
*/
|
||||
public static String deleteChar(String string, char deleteChar) {
|
||||
if (isBlank(string)) {
|
||||
if (noText(string)) {
|
||||
return "";
|
||||
}
|
||||
char[] chars = string.toCharArray();
|
||||
@ -148,7 +148,7 @@ public class StringUtil {
|
||||
}
|
||||
|
||||
public static String deleteChar(String string, char deleteChar1, char deleteChar2) {
|
||||
if (isBlank(string)) {
|
||||
if (noText(string)) {
|
||||
return "";
|
||||
}
|
||||
char[] chars = string.toCharArray();
|
||||
@ -161,30 +161,9 @@ public class StringUtil {
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 字符串为 null 或者内部字符全部为 ' ', '\t', '\n', '\r' 这四类字符时返回 true
|
||||
*/
|
||||
public static boolean isBlank(String string) {
|
||||
if (string == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (int i = 0, len = string.length(); i < len; i++) {
|
||||
if (string.charAt(i) > ' ') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public static boolean isAnyBlank(String... strings) {
|
||||
if (strings == null || strings.length == 0) {
|
||||
throw new IllegalArgumentException("strings is null or empty.");
|
||||
}
|
||||
|
||||
for (String string : strings) {
|
||||
if (isBlank(string)) {
|
||||
private static boolean containsText(CharSequence charSequence) {
|
||||
for (int i = 0; i < charSequence.length(); i++) {
|
||||
if (!Character.isWhitespace(charSequence.charAt(i))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -192,13 +171,25 @@ public class StringUtil {
|
||||
}
|
||||
|
||||
|
||||
public static boolean isNotBlank(String str) {
|
||||
return !isBlank(str);
|
||||
public static boolean hasText(String string) {
|
||||
return string != null && !string.isEmpty() && containsText(string);
|
||||
}
|
||||
|
||||
|
||||
public static boolean areNotBlank(String... strings) {
|
||||
return !isAnyBlank(strings);
|
||||
public static boolean allHasText(String... strings) {
|
||||
for (String string : strings) {
|
||||
if (!hasText(string)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字符串为 null 或者内部字符全部为 ' ', '\t', '\n', '\r' 这四类字符时返回 true
|
||||
*/
|
||||
public static boolean noText(String string) {
|
||||
return !hasText(string);
|
||||
}
|
||||
|
||||
|
||||
@ -209,7 +200,7 @@ public class StringUtil {
|
||||
* @return 全部数数值时返回 true,否则返回 false
|
||||
*/
|
||||
public static boolean isNumeric(String string) {
|
||||
if (isBlank(string)) {
|
||||
if (noText(string)) {
|
||||
return false;
|
||||
}
|
||||
for (int i = string.length(); --i >= 0; ) {
|
||||
@ -223,7 +214,7 @@ public class StringUtil {
|
||||
|
||||
|
||||
public static boolean startsWithAny(String string, String... prefixes) {
|
||||
if (isBlank(string) || prefixes == null) {
|
||||
if (noText(string) || prefixes == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -237,7 +228,7 @@ public class StringUtil {
|
||||
|
||||
|
||||
public static boolean endsWithAny(String str, String... suffixes) {
|
||||
if (isBlank(str) || suffixes == null) {
|
||||
if (noText(str) || suffixes == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -326,7 +317,7 @@ public class StringUtil {
|
||||
}
|
||||
|
||||
public static String buildSchemaWithTable(String schema, String tableName) {
|
||||
return isNotBlank(schema) ? schema + "." + tableName : tableName;
|
||||
return hasText(schema) ? schema + "." + tableName : tableName;
|
||||
}
|
||||
|
||||
public static String[] getSchemaAndTableName(String tableNameWithSchema) {
|
||||
|
||||
@ -44,7 +44,7 @@ public class FlexSpringTransaction implements Transaction {
|
||||
public Connection getConnection() throws SQLException {
|
||||
if (isConnectionTransactional == null) {
|
||||
connection = dataSource.getConnection();
|
||||
isConnectionTransactional = StringUtil.isNotBlank(TransactionContext.getXID());
|
||||
isConnectionTransactional = StringUtil.hasText(TransactionContext.getXID());
|
||||
autoCommit = connection.getAutoCommit();
|
||||
return connection;
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ public class FlexTransactionManager extends AbstractPlatformTransactionManager {
|
||||
@Override
|
||||
protected boolean isExistingTransaction(Object transaction) throws TransactionException {
|
||||
TransactionObject transactionObject = (TransactionObject) transaction;
|
||||
return StringUtil.isNotBlank(transactionObject.prevXid);
|
||||
return StringUtil.hasText(transactionObject.prevXid);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -45,7 +45,7 @@ public class DataSourceInterceptor implements MethodInterceptor {
|
||||
@Override
|
||||
public Object invoke(MethodInvocation invocation) throws Throwable {
|
||||
String dsKey = getDataSourceKey(invocation.getMethod(), invocation.getThis().getClass());
|
||||
if (StringUtil.isBlank(dsKey)) {
|
||||
if (StringUtil.noText(dsKey)) {
|
||||
return invocation.proceed();
|
||||
}
|
||||
try {
|
||||
|
||||
@ -34,7 +34,7 @@ public class ServiceImpl<M extends BaseMapper<T>, T> implements IService<T> {
|
||||
protected M mapper;
|
||||
|
||||
@Override
|
||||
public BaseMapper<T> getMapper() {
|
||||
public M getMapper() {
|
||||
return mapper;
|
||||
}
|
||||
|
||||
|
||||
@ -80,7 +80,7 @@ public class ContributorsDocGen {
|
||||
|
||||
markdown.append("|");
|
||||
|
||||
if (StringUtil.isNotBlank(src)) {
|
||||
if (StringUtil.hasText(src)) {
|
||||
markdown.append("");
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user