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

org.sql2o.DefaultResultSetHandlerFactoryBuilder Maven / Gradle / Ivy

There is a newer version: 0.2.6
Show newest version
package org.sql2o;

import org.sql2o.quirks.Quirks;
import org.sql2o.reflection.PojoMetadata;

import java.util.Map;

public class DefaultResultSetHandlerFactoryBuilder implements ResultSetHandlerFactoryBuilder {
    private boolean caseSensitive;
    private boolean autoDeriveColumnNames;
    private boolean throwOnMappingError;
    private Map columnMappings;
    private Quirks quirks;

    public boolean isCaseSensitive() {
        return caseSensitive;
    }

    public void setCaseSensitive(boolean caseSensitive) {
        this.caseSensitive = caseSensitive;
    }

    public boolean isAutoDeriveColumnNames() {
        return autoDeriveColumnNames;
    }

    public void setAutoDeriveColumnNames(boolean autoDeriveColumnNames) {
        this.autoDeriveColumnNames = autoDeriveColumnNames;
    }

    @Override
    public boolean isThrowOnMappingError() {
        return throwOnMappingError;
    }

    @Override
    public void throwOnMappingError(boolean throwOnMappingError) {
        this.throwOnMappingError = throwOnMappingError;
    }

    public Map getColumnMappings() {
        return columnMappings;
    }

    public void setColumnMappings(Map columnMappings) {
        this.columnMappings = columnMappings;
    }

    public Quirks getQuirks() {
        return quirks;
    }

    public void setQuirks(Quirks quirks) {
        this.quirks = quirks;
    }



    @SuppressWarnings("unchecked")
    public  ResultSetHandlerFactory newFactory(Class clazz) {
        PojoMetadata pojoMetadata = new PojoMetadata(clazz, caseSensitive, autoDeriveColumnNames, columnMappings, throwOnMappingError);
        return new DefaultResultSetHandlerFactory(pojoMetadata, quirks);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy