mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add SetUtil
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package cn.hutool.db;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.lang.func.Func1;
|
||||
import cn.hutool.db.dialect.Dialect;
|
||||
import cn.hutool.db.handler.BeanListHandler;
|
||||
@@ -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(CollUtil.newArrayList(fields), where, rsh);
|
||||
return find(ListUtil.toList(fields), where, rsh);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package cn.hutool.db;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.SetUtil;
|
||||
import cn.hutool.core.lang.func.Func0;
|
||||
import cn.hutool.core.map.Dict;
|
||||
import cn.hutool.core.reflect.MethodUtil;
|
||||
@@ -155,7 +156,7 @@ public class Entity extends Dict {
|
||||
*/
|
||||
public Entity setFieldNames(final Collection<String> fieldNames) {
|
||||
if (CollUtil.isNotEmpty(fieldNames)) {
|
||||
this.fieldNames = CollUtil.newHashSet(true, fieldNames);
|
||||
this.fieldNames = SetUtil.newHashSet(true, fieldNames);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@@ -168,7 +169,7 @@ public class Entity extends Dict {
|
||||
*/
|
||||
public Entity setFieldNames(final String... fieldNames) {
|
||||
if (ArrayUtil.isNotEmpty(fieldNames)) {
|
||||
this.fieldNames = CollUtil.newLinkedHashSet(fieldNames);
|
||||
this.fieldNames = SetUtil.newLinkedHashSet(fieldNames);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package cn.hutool.db.sql;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.db.DbRuntimeException;
|
||||
import cn.hutool.db.Entity;
|
||||
@@ -113,7 +113,7 @@ public class Query implements Cloneable {
|
||||
* @return this
|
||||
*/
|
||||
public Query setFields(final String... fields) {
|
||||
this.fields = CollUtil.newArrayList(fields);
|
||||
this.fields = ListUtil.toList(fields);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user