This commit is contained in:
Looly
2022-05-07 13:24:02 +08:00
parent 029a603d5f
commit 36d75d7030
81 changed files with 525 additions and 494 deletions

View File

@@ -554,7 +554,7 @@ public abstract class AbstractDb<R extends AbstractDb<R>> extends DefaultConnect
* @throws DbRuntimeException SQL执行异常
*/
public <T> T find(final Entity where, final RsHandler<T> rsh, final String... fields) throws DbRuntimeException {
return find(ListUtil.toList(fields), where, rsh);
return find(ListUtil.of(fields), where, rsh);
}
/**

View File

@@ -156,7 +156,7 @@ public class Entity extends Dict {
*/
public Entity setFieldNames(final Collection<String> fieldNames) {
if (CollUtil.isNotEmpty(fieldNames)) {
this.fieldNames = SetUtil.newHashSet(true, fieldNames);
this.fieldNames = SetUtil.of(true, fieldNames);
}
return this;
}
@@ -169,7 +169,7 @@ public class Entity extends Dict {
*/
public Entity setFieldNames(final String... fieldNames) {
if (ArrayUtil.isNotEmpty(fieldNames)) {
this.fieldNames = SetUtil.newLinkedHashSet(fieldNames);
this.fieldNames = SetUtil.ofLinked(fieldNames);
}
return this;
}

View File

@@ -134,7 +134,7 @@ public interface Dialect extends Serializable {
* @throws SQLException SQL执行异常
*/
default PreparedStatement psForCount(final Connection conn, final Query query) throws SQLException {
return psForFind(conn, query.clone().setFields(ListUtil.toList("count(1)")));
return psForFind(conn, query.clone().setFields(ListUtil.of("count(1)")));
}
/**

View File

@@ -272,7 +272,7 @@ public class MetaUtil {
indexInfo.getColumnIndexInfoList().add(ColumnIndexInfo.create(rs));
}
}
table.setIndexInfoList(ListUtil.toList(indexInfoMap.values()));
table.setIndexInfoList(ListUtil.of(indexInfoMap.values()));
}
} catch (final SQLException e) {
throw new DbRuntimeException("Get columns error!", e);

View File

@@ -55,7 +55,7 @@ public class ConditionBuilder implements Builder<String> {
* @return 参数列表
*/
public List<Object> getParamValues() {
return ListUtil.unmodifiable(this.paramValues);
return ListUtil.view(this.paramValues);
}
/**

View File

@@ -113,7 +113,7 @@ public class Query implements Cloneable {
* @return this
*/
public Query setFields(final String... fields) {
this.fields = ListUtil.toList(fields);
this.fields = ListUtil.of(fields);
return this;
}