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

org.simpleflatmapper.jdbc.QueryPreparer Maven / Gradle / Ivy

Go to download

Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.

There is a newer version: 9.0.2
Show newest version
package org.simpleflatmapper.jdbc;

import org.simpleflatmapper.map.Mapper;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public interface QueryPreparer {

    /**
     * Create a new QueryBinder based on the underlying query.
     * @param connection the connection
     * @return the PreparedStatement
     * @throws SQLException if an sql error occurs
     */
    QueryBinder prepare(Connection connection) throws SQLException;

    /**
     * Will create a PreparedStatement based on the query.
     * If any parameters is a List or an array it will throw an UnsupportedOperationException.
     * @param connection the connection
     * @return the PreparedStatement
     * @throws SQLException if an error occurs
     * @throws UnsupportedOperationException if a parameter is an array or a List
     */
    PreparedStatement prepareStatement(Connection connection) throws SQLException;


    /**
     * Will create a PreparedStatement mapper on the query.
     * If any parameters is a List or an array it will throw an UnsupportedOperationException.
     * @return the mapper
     * @throws UnsupportedOperationException if a parameter is an array or a List
     */
    Mapper mapper();

    String toRewrittenSqlQuery(T value);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy