com.star.jdbc.BeanListHandler Maven / Gradle / Ivy
package com.star.jdbc;
import java.sql.ResultSet;
import java.util.List;
/**
* rs转为pojo
*
* 借鉴dbutils
*
* @author starhq
*/
public class BeanListHandler implements RsHandler> {
/**
* 要转的类型
*/
private transient final Class type;
/**
* 解析器
*/
private transient final BeanProcessor processor = new BeanProcessor();
/**
* 构造方法
*/
public BeanListHandler(final Class type) {
super();
this.type = type;
}
/**
* result转换
*/
@Override
public List handle(final ResultSet resultSet) {
return processor.toBeanList(resultSet, type);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy