org.hibernate.procedure.spi.CallableStatementSupport 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
JPMS Module-Info's for a few of the Jakarta Libraries just until they add them in themselves
/*
* 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 .
*/
package org.hibernate.procedure.spi;
import java.sql.CallableStatement;
import java.util.ArrayList;
import java.util.List;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.query.procedure.internal.ProcedureParamBindings;
import org.hibernate.query.procedure.internal.ProcedureParameterMetadata;
/**
* @author Steve Ebersole
*/
public interface CallableStatementSupport {
default String renderCallableStatement(
String name,
ParameterStrategy parameterStrategy,
List> parameterRegistrations,
SharedSessionContractImplementor session) {
throw new UnsupportedOperationException(
"Legacy #renderCallableStatement called but implementation does not support that call."
);
}
default String renderCallableStatement(
String procedureName,
ProcedureParameterMetadata parameterMetadata,
ProcedureParamBindings paramBindings,
SharedSessionContractImplementor session) {
return renderCallableStatement(
procedureName,
parameterMetadata.getParameterStrategy(),
new ArrayList( parameterMetadata.collectAllParameters() ),
session
);
}
void registerParameters(
String procedureName,
CallableStatement statement,
ParameterStrategy parameterStrategy,
List> parameterRegistrations,
SharedSessionContractImplementor session);
}