org.simpleflatmapper.jdbc.converter.JdbcConverterFactoryProducer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sfm-jdbc Show documentation
Show all versions of sfm-jdbc Show documentation
Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.
package org.simpleflatmapper.jdbc.converter;
import org.simpleflatmapper.converter.AbstractConverterFactory;
import org.simpleflatmapper.converter.AbstractConverterFactoryProducer;
import org.simpleflatmapper.converter.Converter;
import org.simpleflatmapper.converter.ConverterFactory;
import java.lang.reflect.Type;
import java.sql.Array;
import java.sql.Date;
import java.sql.ResultSet;
import java.sql.Time;
import org.simpleflatmapper.converter.ConvertingScore;
import org.simpleflatmapper.converter.ConvertingTypes;
import org.simpleflatmapper.jdbc.JdbcColumnKey;
import org.simpleflatmapper.jdbc.ResultSetGetterFactory;
import org.simpleflatmapper.reflect.Getter;
import org.simpleflatmapper.util.Consumer;
import org.simpleflatmapper.util.Supplier;
import org.simpleflatmapper.util.SupplierHelper;
import java.sql.Timestamp;
import org.simpleflatmapper.util.TypeHelper;
//IFJAVA8_START
import org.simpleflatmapper.jdbc.converter.time.DateToLocalDateConverter;
import org.simpleflatmapper.jdbc.converter.time.TimeToLocalTimeConverter;
import org.simpleflatmapper.jdbc.converter.time.TimeToOffsetTimeConverter;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.OffsetTime;
import java.time.ZoneOffset;
//IFJAVA8_END
import java.util.Calendar;
import java.util.List;
public class JdbcConverterFactoryProducer extends AbstractConverterFactoryProducer {
@Override
public void produce(Consumer super ConverterFactory, ?>> consumer) {
//IFJAVA8_START
constantConverter(consumer, Time.class, LocalTime.class, new TimeToLocalTimeConverter());
constantConverter(consumer, Date.class, LocalDate.class, new DateToLocalDateConverter());
factoryConverter(consumer, new AbstractConverterFactory