This commit is contained in:
Looly
2019-10-29 19:05:23 +08:00
parent 3cef7fa9a7
commit bf03aebcef
107 changed files with 283 additions and 456 deletions

View File

@@ -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;
/**
* 是否支持事务
*/

View File

@@ -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
/**

View File

@@ -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));
}
}

View File

@@ -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) {

View File

@@ -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);
}
}