org.hibernate.sql.exec.spi.JdbcParameterBindings Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-core Show documentation
Show all versions of hibernate-core Show documentation
Hibernate's core ORM functionality
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
*/
package org.hibernate.sql.exec.spi;
import java.util.Collection;
import java.util.Collections;
import java.util.function.BiConsumer;
/**
* Access to all of the externalized JDBC parameter bindings
*
* @apiNote "Externalized" because some JDBC parameter values are
* intrinsically part of the parameter itself and we do not need to
* locate a JdbcParameterBinding. E.g., consider a
* {@link org.hibernate.sql.ast.tree.expression.LiteralParameter}
* which actually encapsulates the actually literal value inside
* itself - to create the binder and actually perform the binding
* is only dependent on the LiteralParameter
*
* @author Steve Ebersole
*/
public interface JdbcParameterBindings {
void addBinding(JdbcParameter parameter, JdbcParameterBinding binding);
Collection getBindings();
JdbcParameterBinding getBinding(JdbcParameter parameter);
void visitBindings(BiConsumer action);
JdbcParameterBindings NO_BINDINGS = new JdbcParameterBindings() {
@Override
public void addBinding(JdbcParameter parameter, JdbcParameterBinding binding) {
}
@Override
public Collection getBindings() {
return Collections.emptyList();
}
@Override
public JdbcParameterBinding getBinding(JdbcParameter parameter) {
return null;
}
@Override
public void visitBindings(BiConsumer action) {
}
};
}