com.wizarius.orm.database.handlers.WritableHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wizarius-orm Show documentation
Show all versions of wizarius-orm Show documentation
Java orm for Postgres or Mysql with migration system and connection pool
package com.wizarius.orm.database.handlers;
import com.wizarius.orm.database.DBParsedField;
import com.wizarius.orm.database.interfaces.DBEntity;
import java.lang.reflect.Field;
import java.sql.PreparedStatement;
import java.sql.SQLException;
/**
* Created by Vladyslav Shyshkin on 04.04.2018.
*/
public interface WritableHandler {
/**
* Set value in prepared statement
*
* @param field field
* @param entity entity
* @param parsedField parsed field
* @param parameterIndex parameterIndex in prepare statement
* @param preparedStatement prepare statement
* @throws Exception on unable to build sql query on get field
*/
void set(Field field,
DBEntity entity,
DBParsedField parsedField,
int parameterIndex,
PreparedStatement preparedStatement) throws Exception;
/**
* Set value in prepared statement
*
* @param value value
* @param parameterIndex parameter index
* @param preparedStatement prepared statement
* @throws SQLException on unable to build sql query
*/
void set(T value,
int parameterIndex,
PreparedStatement preparedStatement) throws SQLException;
}