All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cool.scx.jdbc.result_handler.BeanConsumerHandler Maven / Gradle / Ivy

There is a newer version: 2.7.4
Show newest version
package cool.scx.jdbc.result_handler;

import cool.scx.jdbc.bean_builder.BeanBuilder;
import cool.scx.jdbc.dialect.Dialect;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.function.Consumer;

/**
 * 

BeanBuilder interface.

* * @author scx567888 * @version 0.2.1 */ record BeanConsumerHandler(BeanBuilder beanBuilder, Consumer consumer) implements ResultHandler { @Override public Void apply(ResultSet rs, Dialect dialect) throws SQLException { beanBuilder.bindDialect(dialect); var indexInfo = beanBuilder.getIndexInfo(rs.getMetaData()); while (rs.next()) { T t = beanBuilder.createBean(rs, indexInfo); consumer.accept(t); } return null; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy