com.star.jdbc.BeanHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common Show documentation
Show all versions of common Show documentation
some utility class for java develop
The newest version!
package com.star.jdbc;
import java.sql.ResultSet;
/**
* rs转为pojo
*
* 借鉴dbutils
*
* @author starhq
*/
public class BeanHandler implements RsHandler {
/**
* 要转的类型
*/
private transient final Class type;
/**
* 解析器
*/
private transient final BeanProcessor processor = new BeanProcessor();
/**
* 构造方法
*/
public BeanHandler(final Class type) {
super();
this.type = type;
}
/**
* result转换
*/
@Override
public T handle(final ResultSet resultSet) {
return processor.toBean(resultSet, type);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy