mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -33,7 +33,7 @@ import cn.hutool.db.sql.Wrapper;
|
||||
public abstract class AbstractDb implements Serializable {
|
||||
private static final long serialVersionUID = 3858951941916349062L;
|
||||
|
||||
protected DataSource ds;
|
||||
protected final DataSource ds;
|
||||
/**
|
||||
* 是否支持事务
|
||||
*/
|
||||
|
@@ -15,7 +15,7 @@ import cn.hutool.core.map.MapUtil;
|
||||
public class ActiveEntity extends Entity {
|
||||
private static final long serialVersionUID = 6112321379601134750L;
|
||||
|
||||
private Db db;
|
||||
private final Db db;
|
||||
|
||||
// --------------------------------------------------------------- Static method start
|
||||
/**
|
||||
|
@@ -44,7 +44,6 @@ public class HikariDSFactory extends AbstractDSFactory {
|
||||
config.put("password", pass);
|
||||
}
|
||||
|
||||
final HikariDataSource ds = new HikariDataSource(new HikariConfig(config));
|
||||
return ds;
|
||||
return new HikariDataSource(new HikariConfig(config));
|
||||
}
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ import java.sql.SQLException;
|
||||
public class BeanHandler<E> implements RsHandler<E>{
|
||||
private static final long serialVersionUID = -5491214744966544475L;
|
||||
|
||||
private Class<E> elementBeanType;
|
||||
private final Class<E> elementBeanType;
|
||||
|
||||
/**
|
||||
* 创建一个 BeanHandler对象
|
||||
@@ -24,7 +24,7 @@ public class BeanHandler<E> implements RsHandler<E>{
|
||||
* @return BeanHandler对象
|
||||
*/
|
||||
public static <E> BeanHandler<E> create(Class<E> beanType) {
|
||||
return new BeanHandler<E>(beanType);
|
||||
return new BeanHandler<>(beanType);
|
||||
}
|
||||
|
||||
public BeanHandler(Class<E> beanType) {
|
||||
|
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
public class BeanListHandler<E> implements RsHandler<List<E>> {
|
||||
private static final long serialVersionUID = 4510569754766197707L;
|
||||
|
||||
private Class<E> elementBeanType;
|
||||
private final Class<E> elementBeanType;
|
||||
|
||||
/**
|
||||
* 创建一个 BeanListHandler对象
|
||||
@@ -25,7 +25,7 @@ public class BeanListHandler<E> implements RsHandler<List<E>> {
|
||||
* @return BeanListHandler对象
|
||||
*/
|
||||
public static <E> BeanListHandler<E> create(Class<E> beanType) {
|
||||
return new BeanListHandler<E>(beanType);
|
||||
return new BeanListHandler<>(beanType);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -38,6 +38,6 @@ public class BeanListHandler<E> implements RsHandler<List<E>> {
|
||||
|
||||
@Override
|
||||
public List<E> handle(ResultSet rs) throws SQLException {
|
||||
return HandleHelper.handleRsToBeanList(rs, new ArrayList<E>(), elementBeanType);
|
||||
return HandleHelper.handleRsToBeanList(rs, new ArrayList<>(), elementBeanType);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user