diff --git a/hibernate-core/src/main/java/org/hibernate/jpa/HibernateHints.java b/hibernate-core/src/main/java/org/hibernate/jpa/HibernateHints.java
index 566d8e179473..537964225dc5 100644
--- a/hibernate-core/src/main/java/org/hibernate/jpa/HibernateHints.java
+++ b/hibernate-core/src/main/java/org/hibernate/jpa/HibernateHints.java
@@ -151,10 +151,33 @@ public interface HibernateHints {
/**
* Whether to treat a {@link org.hibernate.procedure.ProcedureCall}
* or {@link jakarta.persistence.StoredProcedureQuery} as a call
- * to a function rather than a call to a procedure.
+ * to a function rather than a call to a procedure. Set hint to
+ * {@link Boolean#TRUE TRUE} or {@code "true"} to indicated that
+ * the call should be treated as a function call.
+ *
+ * When no other return type is indicated, a function is assumed
+ * to return {@link java.sql.Types#REF_CURSOR REF_CURSOR}.
+ *
+ * @see org.hibernate.procedure.ProcedureCall#markAsFunctionCall
+ * @see #HINT_CALLABLE_FUNCTION_RETURN_TYPE
*/
String HINT_CALLABLE_FUNCTION = "org.hibernate.callableFunction";
+ /**
+ * The {@linkplain org.hibernate.type.SqlTypes JDBC type code},
+ * {@linkplain org.hibernate.query.BindableType type}, or
+ * {@link Class} of the value returned by a SQL function called
+ * via {@link org.hibernate.procedure.ProcedureCall} or
+ * {@link jakarta.persistence.StoredProcedureQuery}. Has the side
+ * effect of causing the call to be treated as a function call
+ * rather than a call to a stored procedure.
+ *
+ * @see org.hibernate.procedure.ProcedureCall#markAsFunctionCall(int)
+ * @see org.hibernate.procedure.ProcedureCall#markAsFunctionCall(org.hibernate.query.BindableType)
+ * @see org.hibernate.procedure.ProcedureCall#markAsFunctionCall(Class)
+ */
+ String HINT_CALLABLE_FUNCTION_RETURN_TYPE = "hibernate.procedure.function_return_jdbc_type_code";
+
/**
* Hint for specifying the tenant id to use when creating an
* {@link jakarta.persistence.EntityManagerFactory#createEntityManager(java.util.Map) EntityManager}.
diff --git a/hibernate-core/src/main/java/org/hibernate/procedure/FunctionReturn.java b/hibernate-core/src/main/java/org/hibernate/procedure/FunctionReturn.java
index f851047d917c..0f0f21ff3c96 100644
--- a/hibernate-core/src/main/java/org/hibernate/procedure/FunctionReturn.java
+++ b/hibernate-core/src/main/java/org/hibernate/procedure/FunctionReturn.java
@@ -4,14 +4,23 @@
*/
package org.hibernate.procedure;
+import org.hibernate.Incubating;
import org.hibernate.query.procedure.ProcedureParameter;
/**
- * Describes the function return for ProcedureCalls that represent calls to
- * a function ({@code "{? = call ...}} syntax) rather that a proc ({@code {call ...}} syntax)
+ * Describes the function return value of a {@link ProcedureCall}
+ * executed via a JDBC escape of form ({@code "{? = call ...}}.
+ * That is, the {@code ?} parameter occurring before the {@code =}.
*
* @author Steve Ebersole
+ *
+ * @since 6.0
*/
+@Incubating
public interface FunctionReturn extends ProcedureParameter {
+ /**
+ * The {@linkplain org.hibernate.type.SqlTypes JDBC type code}
+ * representing the SQL type of the function return value.
+ */
int getJdbcTypeCode();
}
diff --git a/hibernate-core/src/main/java/org/hibernate/procedure/ProcedureCall.java b/hibernate-core/src/main/java/org/hibernate/procedure/ProcedureCall.java
index 7301cd92580a..bdab4e201754 100644
--- a/hibernate-core/src/main/java/org/hibernate/procedure/ProcedureCall.java
+++ b/hibernate-core/src/main/java/org/hibernate/procedure/ProcedureCall.java
@@ -14,41 +14,61 @@
import jakarta.persistence.StoredProcedureQuery;
import jakarta.persistence.TemporalType;
+import org.hibernate.Incubating;
import org.hibernate.MappingException;
+import org.hibernate.query.BindableType;
import org.hibernate.query.SynchronizeableQuery;
import org.hibernate.query.CommonQueryContract;
import org.hibernate.query.procedure.ProcedureParameter;
-import org.hibernate.type.BasicTypeReference;
/**
- * Defines support for executing database stored procedures and functions.
+ * Defines support for executing database stored procedures and functions using the
+ * {@linkplain java.sql.CallableStatement JDBC stored procedure SQL escape syntax}.
*
- * Note that here we use the terms "procedure" and "function" as follows:
- * - procedure is a named database executable we expect to call via : {@code {call procedureName(...)}}
- * - function is a named database executable we expect to call via : {@code {? = call functionName(...)}}
+ * Here we use the terms "procedure" and "function" as follows:
+ * - A procedure is a named database executable called via:
+ * {@code {call procedureName(...)}}
+ * - A function is a named database executable called via:
+ * {@code {? = call functionName(...)}}
*
*
- * Unless explicitly specified, the ProcedureCall is assumed to follow the
- * procedure call syntax. To explicitly specify that this should be a function
- * call, use {@link #markAsFunctionCall}.
+ * Unless explicitly specified, the {@code ProcedureCall} is executed using the
+ * procedure call syntax. To explicitly specify that the function call syntax
+ * should be used, call {@link #markAsFunctionCall}. Clients of the JPA-standard
+ * {@link StoredProcedureQuery} interface may choose between:
+ *
+ * - using {@link #unwrap storedProcedureQuery.unwrap(ProcedureCall.class).markAsFunctionCall(returnType)},
+ * or
+ *
- setting the {@value org.hibernate.jpa.HibernateHints#HINT_CALLABLE_FUNCTION}
+ * or {@value org.hibernate.jpa.HibernateHints#HINT_CALLABLE_FUNCTION_RETURN_TYPE}
+ * {@linkplain #setHint(String, Object) hint} to avoid the cast to a
+ * Hibernate-specific class.
+ *
*
- * When using function-call syntax:
- * - parameters must be registered by position (not name)
- * - The first parameter is considered to be the function return (the `?` before the call)
- * - the first parameter must have mode of OUT, INOUT or REF_CURSOR; IN is invalid
+ * When the function call syntax is used:
+ *
+ * - parameters must be registered by position (not name),
+ *
- the first parameter is considered to represent the function return value
+ * (corresponding to the {@code ?} which occurs before the {@code =}), and
+ *
- the first parameter must have {@linkplain ParameterMode mode} OUT, INOUT,
+ * or REF_CURSOR; {@linkplain ParameterMode#IN IN} is illegal.
*
*
- * In some cases, based on the Dialect, we will have other validations and
- * assumptions as well. For example, on PGSQL, whenever we see a REF_CURSOR mode
- * parameter, we know that:
- * -
- * this will be a function call (so we call {@link #markAsFunctionCall} implicitly) because
- * that is the only way PGSQL supports returning REF_CURSOR results.
- *
- * - there can be only one REF_CURSOR mode parameter
+ * Depending on the {@linkplain org.hibernate.dialect.Dialect SQL dialect},
+ * further constraints are enforced or inferred. For example, on PostgreSQL:
+ *
+ * - If a parameter has mode {@linkplain ParameterMode#REF_CURSOR REF_CURSOR},
+ * it's automatically inferred that the call is a function call because this
+ * is the only context in which PostgreSQL returns REF_CURSOR results.
+ * So it's not necessary to call {@link #markAsFunctionCall} explicitly.
+ *
- The restriction that there may be at most one REF_CURSOR mode parameter
+ * is enforced.
*
*
* @author Steve Ebersole
+ *
+ * @see java.sql.CallableStatement
+ * @see StoredProcedureQuery
*/
public interface ProcedureCall
extends CommonQueryContract, SynchronizeableQuery, StoredProcedureQuery, AutoCloseable {
@@ -74,7 +94,7 @@ public interface ProcedureCall
boolean isFunctionCall();
/**
- * Mark this ProcedureCall as representing a call to a database function,
+ * Mark this {@code ProcedureCall} as representing a call to a database function,
* rather than a database procedure.
*
* @param sqlType The {@link java.sql.Types} code for the function return
@@ -84,7 +104,7 @@ public interface ProcedureCall
ProcedureCall markAsFunctionCall(int sqlType);
/**
- * Mark this ProcedureCall as representing a call to a database function,
+ * Mark this {@code ProcedureCall} as representing a call to a database function,
* rather than a database procedure.
*
* @param resultType The result type for the function return
@@ -95,7 +115,7 @@ public interface ProcedureCall
ProcedureCall markAsFunctionCall(Class> resultType);
/**
- * Mark this ProcedureCall as representing a call to a database function,
+ * Mark this {@code ProcedureCall} as representing a call to a database function,
* rather than a database procedure.
*
* @param typeReference The result type for the function return
@@ -103,7 +123,7 @@ public interface ProcedureCall
* @return {@code this}, for method chaining
* @since 6.2
*/
- ProcedureCall markAsFunctionCall(BasicTypeReference> typeReference);
+ ProcedureCall markAsFunctionCall(BindableType> typeReference);
/**
* Basic form for registering a positional parameter.
@@ -127,13 +147,13 @@ public interface ProcedureCall
*
* @return The parameter registration memento
*/
- ProcedureParameter registerParameter(int position, BasicTypeReference type, ParameterMode mode);
+ ProcedureParameter registerParameter(int position, BindableType type, ParameterMode mode);
/**
- * Like {@link #registerStoredProcedureParameter(int, Class, ParameterMode)} but a basic type reference is given
+ * Like {@link #registerStoredProcedureParameter(int, Class, ParameterMode)} but a type reference is given
* instead of a class for the parameter type.
*/
- ProcedureCall registerStoredProcedureParameter(int position, BasicTypeReference> type, ParameterMode mode);
+ ProcedureCall registerStoredProcedureParameter(int position, BindableType> type, ParameterMode mode);
/**
* Retrieve a previously registered parameter memento by the position under which it was registered.
@@ -176,14 +196,14 @@ ProcedureParameter registerParameter(String parameterName, Class type,
* @throws NamedParametersNotSupportedException When the underlying database is known to not support
* named procedure parameters.
*/
- ProcedureParameter registerParameter(String parameterName, BasicTypeReference type, ParameterMode mode)
+ ProcedureParameter registerParameter(String parameterName, BindableType type, ParameterMode mode)
throws NamedParametersNotSupportedException;
/**
- * Like {@link #registerStoredProcedureParameter(String, Class, ParameterMode)} but a basic type reference is given
+ * Like {@link #registerStoredProcedureParameter(String, Class, ParameterMode)} but a type reference is given
* instead of a class for the parameter type.
*/
- ProcedureCall registerStoredProcedureParameter(String parameterName, BasicTypeReference> type, ParameterMode mode);
+ ProcedureCall registerStoredProcedureParameter(String parameterName, BindableType> type, ParameterMode mode);
/**
* Retrieve a previously registered parameter memento by the name under which it was registered.
@@ -215,6 +235,16 @@ ProcedureParameter registerParameter(String parameterName, BasicTypeRefer
*/
ProcedureOutputs getOutputs();
+ /**
+ * The {@link FunctionReturn} describing the return value of
+ * the function, or {@code null} if this {@code ProcedureCall}
+ * is not a function call.
+ *
+ * @since 7.0
+ */
+ @Incubating
+ FunctionReturn> getFunctionReturn();
+
/**
* Release the underlying JDBC {@link java.sql.CallableStatement}
*/
@@ -223,9 +253,7 @@ default void close() {
getOutputs().release();
}
- /*
- Covariant overrides
- */
+ /* Covariant overrides */
@Override
ProcedureCall addSynchronizedQuerySpace(String querySpace);
@@ -276,10 +304,10 @@ default void close() {
ProcedureCall registerStoredProcedureParameter(String parameterName, Class> type, ParameterMode mode);
/**
- * The hint key indicating the function's return {@linkplain java.sql.Types JDBC type code}.
+ * The hint key indicating the return {@linkplain java.sql.Types JDBC type code} of a function.
*
- * @deprecated This hint no longer has any effect. Use {@link #markAsFunctionCall(int)}.
+ * @deprecated Use {@link org.hibernate.jpa.HibernateHints#HINT_CALLABLE_FUNCTION_RETURN_TYPE}.
*/
@Deprecated(since="7", forRemoval = true)
- String FUNCTION_RETURN_TYPE_HINT = "hibernate.procedure.function_return_jdbc_type_code";
+ String FUNCTION_RETURN_TYPE_HINT = org.hibernate.jpa.HibernateHints.HINT_CALLABLE_FUNCTION_RETURN_TYPE;
}
diff --git a/hibernate-core/src/main/java/org/hibernate/procedure/internal/OracleCallableStatementSupport.java b/hibernate-core/src/main/java/org/hibernate/procedure/internal/OracleCallableStatementSupport.java
index 65fd3ca7ee5f..244b606ed25c 100644
--- a/hibernate-core/src/main/java/org/hibernate/procedure/internal/OracleCallableStatementSupport.java
+++ b/hibernate-core/src/main/java/org/hibernate/procedure/internal/OracleCallableStatementSupport.java
@@ -24,7 +24,7 @@ public OracleCallableStatementSupport(boolean supportsRefCursors) {
@Override
protected void appendNameParameter(
StringBuilder buffer,
- ProcedureParameterImplementor parameter,
+ ProcedureParameterImplementor> parameter,
JdbcCallParameterRegistration registration) {
buffer.append( parameter.getName() ).append( " => ?" );
}
diff --git a/hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureCallImpl.java b/hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureCallImpl.java
index 9adf56e0862a..c4a1c1e080a4 100644
--- a/hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureCallImpl.java
+++ b/hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureCallImpl.java
@@ -74,7 +74,6 @@
import org.hibernate.sql.exec.spi.JdbcParameterBindings;
import org.hibernate.sql.results.NoMoreOutputsException;
import org.hibernate.type.BasicType;
-import org.hibernate.type.BasicTypeReference;
import org.hibernate.type.spi.TypeConfiguration;
import jakarta.persistence.CacheRetrieveMode;
@@ -96,6 +95,7 @@
import static java.util.Collections.unmodifiableSet;
import static org.hibernate.internal.util.StringHelper.join;
import static org.hibernate.jpa.HibernateHints.HINT_CALLABLE_FUNCTION;
+import static org.hibernate.jpa.HibernateHints.HINT_CALLABLE_FUNCTION_RETURN_TYPE;
import static org.hibernate.procedure.internal.NamedCallableQueryMementoImpl.ParameterMementoImpl.fromRegistration;
import static org.hibernate.query.results.ResultSetMapping.resolveResultSetMapping;
@@ -295,17 +295,6 @@ public ProcedureCallImpl(
applyOptions( memento );
}
- protected void applyOptions(NamedCallableQueryMemento memento) {
- super.applyOptions( memento );
-
- if ( memento.getHints() != null ) {
- final Object callableFunction = memento.getHints().get( HINT_CALLABLE_FUNCTION );
- if ( callableFunction != null && parseBoolean( callableFunction.toString() ) ) {
- applyCallableFunctionHint();
- }
- }
- }
-
private void applyCallableFunctionHint() {
final List> resultTypes = new ArrayList<>();
resultSetMapping.visitResultBuilders(
@@ -361,7 +350,7 @@ public FunctionReturnImplementor getFunctionReturn() {
}
@Override
- public ProcedureCallImpl markAsFunctionCall(int sqlType) {
+ public ProcedureCallImplementor markAsFunctionCall(int sqlType) {
functionReturn = new FunctionReturnImpl<>( this, sqlType );
return this;
}
@@ -385,13 +374,19 @@ public ProcedureCallImpl markAsFunctionCall(Class> resultType) {
}
@Override
- public ProcedureCallImpl markAsFunctionCall(BasicTypeReference> typeReference) {
- final BasicType> basicType =
- getTypeConfiguration().getBasicTypeRegistry().resolve( typeReference );
- if ( basicType == null ) {
- throw new IllegalArgumentException( "Could not resolve a BasicType for the java type: " + typeReference.getName() );
+ public ProcedureCall markAsFunctionCall(BindableType> typeReference) {
+ if ( !(typeReference instanceof OutputableType> outputableType) ) {
+ throw new IllegalArgumentException( "Given type is not an OutputableType: " + typeReference );
}
- markAsFunctionCall( basicType );
+ if ( resultSetMapping.getNumberOfResultBuilders() == 0 ) {
+ final SqmExpressible> expressible =
+ typeReference.resolveExpressible( getSessionFactory().getRuntimeMetamodels() );
+ // Function returns might not be represented as callable parameters,
+ // but we still want to convert the result to the requested java type if possible
+ resultSetMapping.addResultBuilder( new ScalarDomainResultBuilder<>( expressible.getExpressibleJavaType() ) );
+ }
+ //noinspection unchecked
+ functionReturn = new FunctionReturnImpl<>( this, (OutputableType) outputableType );
return this;
}
@@ -452,7 +447,7 @@ public ProcedureCallImplementor registerStoredProcedureParameter(
@Override
public ProcedureCallImplementor registerStoredProcedureParameter(
int position,
- BasicTypeReference> type,
+ BindableType> type,
ParameterMode mode) {
getSession().checkOpen( true );
@@ -472,7 +467,7 @@ public ProcedureCallImplementor registerStoredProcedureParameter(
@Override
public ProcedureCallImplementor registerStoredProcedureParameter(
String parameterName,
- BasicTypeReference> type,
+ BindableType> type,
ParameterMode mode) {
getSession().checkOpen( true );
try {
@@ -501,12 +496,12 @@ public ProcedureParameter registerParameter(int position, Class javaTy
@Override
public ProcedureParameter registerParameter(
int position,
- BasicTypeReference typeReference,
+ BindableType typeReference,
ParameterMode mode) {
- final BasicType basicType =
- getTypeConfiguration().getBasicTypeRegistry().resolve( typeReference );
+ final SqmExpressible expressible =
+ typeReference.resolveExpressible( getSessionFactory().getRuntimeMetamodels() );
final ProcedureParameterImpl procedureParameter =
- new ProcedureParameterImpl<>( position, mode, basicType.getJavaType(), basicType );
+ new ProcedureParameterImpl<>( position, mode, typeReference.getBindableJavaType(), expressible );
registerParameter( procedureParameter );
return procedureParameter;
}
@@ -545,12 +540,12 @@ private Class getExpressibleJavaType(BindableType parameterType) {
@Override
public ProcedureParameterImplementor registerParameter(
String name,
- BasicTypeReference typeReference,
+ BindableType typeReference,
ParameterMode mode) {
- final BasicType basicType =
- getTypeConfiguration().getBasicTypeRegistry().resolve( typeReference );
+ final SqmExpressible expressible =
+ typeReference.resolveExpressible( getSessionFactory().getRuntimeMetamodels() );
final ProcedureParameterImpl parameter =
- new ProcedureParameterImpl<>( name, mode, basicType.getJavaType(), basicType );
+ new ProcedureParameterImpl<>( name, mode, typeReference.getBindableJavaType(), expressible );
registerParameter( parameter );
return parameter;
}
@@ -1064,13 +1059,41 @@ public QueryImplementor setLockOptions(LockOptions lockOptions) {
@Override
public ProcedureCallImplementor setHint(String hintName, Object value) {
- if ( HINT_CALLABLE_FUNCTION.equals( hintName ) ) {
- if ( value != null && parseBoolean( value.toString() ) ) {
- applyCallableFunctionHint();
- }
- }
- else {
- super.setHint( hintName, value );
+ switch ( hintName ) {
+ case HINT_CALLABLE_FUNCTION:
+ if ( value != null ) {
+ if ( value instanceof Boolean bool ) {
+ if ( bool ) {
+ applyCallableFunctionHint();
+ }
+ }
+ else if ( parseBoolean( value.toString() ) ) {
+ applyCallableFunctionHint();
+ }
+ }
+ break;
+ case HINT_CALLABLE_FUNCTION_RETURN_TYPE:
+ if ( value != null ) {
+ if ( value instanceof Integer code ) {
+ //noinspection resource
+ markAsFunctionCall( code );
+ }
+ else if ( value instanceof BindableType> type ) {
+ //noinspection resource
+ markAsFunctionCall( type );
+ }
+ else if ( value instanceof Class> type ) {
+ //noinspection resource
+ markAsFunctionCall( type );
+ }
+ else {
+ //noinspection resource
+ markAsFunctionCall( Integer.parseInt( value.toString() ) );
+ }
+ }
+ break;
+ default:
+ super.setHint( hintName, value );
}
return this;
}
diff --git a/hibernate-core/src/main/java/org/hibernate/procedure/internal/SQLServerCallableStatementSupport.java b/hibernate-core/src/main/java/org/hibernate/procedure/internal/SQLServerCallableStatementSupport.java
index 20fecc6852f8..ad7c56c99e9c 100644
--- a/hibernate-core/src/main/java/org/hibernate/procedure/internal/SQLServerCallableStatementSupport.java
+++ b/hibernate-core/src/main/java/org/hibernate/procedure/internal/SQLServerCallableStatementSupport.java
@@ -17,7 +17,10 @@ private SQLServerCallableStatementSupport() {
}
@Override
- protected void appendNameParameter(StringBuilder buffer, ProcedureParameterImplementor parameter, JdbcCallParameterRegistration registration) {
+ protected void appendNameParameter(
+ StringBuilder buffer,
+ ProcedureParameterImplementor> parameter,
+ JdbcCallParameterRegistration registration) {
buffer.append( '@' ).append( parameter.getName() ).append( " = ?" );
}
}
diff --git a/hibernate-core/src/main/java/org/hibernate/procedure/internal/StandardCallableStatementSupport.java b/hibernate-core/src/main/java/org/hibernate/procedure/internal/StandardCallableStatementSupport.java
index 595550cfaa0a..33966ce9fd5b 100644
--- a/hibernate-core/src/main/java/org/hibernate/procedure/internal/StandardCallableStatementSupport.java
+++ b/hibernate-core/src/main/java/org/hibernate/procedure/internal/StandardCallableStatementSupport.java
@@ -4,8 +4,6 @@
*/
package org.hibernate.procedure.internal;
-import java.util.List;
-
import org.hibernate.QueryException;
import org.hibernate.dialect.Dialect;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
@@ -49,16 +47,13 @@ public JdbcOperationQueryCall interpretCall(ProcedureCallImplementor> procedur
final FunctionReturnImplementor> functionReturn = procedureCall.getFunctionReturn();
final ProcedureParameterMetadataImplementor parameterMetadata = procedureCall.getParameterMetadata();
final SharedSessionContractImplementor session = procedureCall.getSession();
- final List extends ProcedureParameterImplementor>> registrations = parameterMetadata.getRegistrationsAsList();
- final int paramStringSizeEstimate;
- if ( functionReturn == null && parameterMetadata.hasNamedParameters() ) {
- // That's just a rough estimate. I guess most params will have fewer than 8 chars on average
- paramStringSizeEstimate = registrations.size() * 10;
- }
- else {
- // For every param rendered as '?' we have a comma, hence the estimate
- paramStringSizeEstimate = registrations.size() * 2;
- }
+ final var registrations = parameterMetadata.getRegistrationsAsList();
+ final int paramStringSizeEstimate =
+ functionReturn == null && parameterMetadata.hasNamedParameters()
+ // That's just a rough estimate. I guess most params will have fewer than 8 chars on average
+ ? registrations.size() * 10
+ // For every param rendered as '?' we have a comma, hence the estimate
+ : registrations.size() * 2;
final JdbcCallImpl.Builder builder = new JdbcCallImpl.Builder();
final StringBuilder buffer;
final int offset;
@@ -110,7 +105,7 @@ public JdbcOperationQueryCall interpretCall(ProcedureCallImplementor> procedur
protected void appendNameParameter(
StringBuilder buffer,
- ProcedureParameterImplementor parameter,
+ ProcedureParameterImplementor> parameter,
JdbcCallParameterRegistration registration) {
buffer.append( '?' );
}
diff --git a/hibernate-core/src/main/java/org/hibernate/procedure/spi/ProcedureCallImplementor.java b/hibernate-core/src/main/java/org/hibernate/procedure/spi/ProcedureCallImplementor.java
index 5bb60b94bce1..8cbf0d73496d 100644
--- a/hibernate-core/src/main/java/org/hibernate/procedure/spi/ProcedureCallImplementor.java
+++ b/hibernate-core/src/main/java/org/hibernate/procedure/spi/ProcedureCallImplementor.java
@@ -9,10 +9,10 @@
import java.util.List;
import org.hibernate.procedure.ProcedureCall;
+import org.hibernate.query.BindableType;
import org.hibernate.query.named.NameableQuery;
import org.hibernate.query.spi.ProcedureParameterMetadataImplementor;
import org.hibernate.query.spi.QueryImplementor;
-import org.hibernate.type.BasicTypeReference;
import jakarta.persistence.CacheRetrieveMode;
import jakarta.persistence.CacheStoreMode;
@@ -32,6 +32,7 @@ default List getResultList() {
ParameterStrategy getParameterStrategy();
+ @Override
FunctionReturnImplementor getFunctionReturn();
@Override
@@ -41,10 +42,16 @@ default List getResultList() {
R getSingleResult();
@Override
- ProcedureCallImplementor registerStoredProcedureParameter(int position, BasicTypeReference> type, ParameterMode mode);
+ ProcedureCallImplementor registerStoredProcedureParameter(int position, Class> type, ParameterMode mode);
+
+ @Override
+ ProcedureCallImplementor registerStoredProcedureParameter(String parameterName, Class> type, ParameterMode mode);
+
+ @Override
+ ProcedureCallImplementor registerStoredProcedureParameter(int position, BindableType> type, ParameterMode mode);
@Override
- ProcedureCallImplementor registerStoredProcedureParameter(String parameterName, BasicTypeReference> type, ParameterMode mode);
+ ProcedureCallImplementor registerStoredProcedureParameter(String parameterName, BindableType> type, ParameterMode mode);
@Override
ProcedureCallImplementor setHint(String hintName, Object value);
@@ -88,12 +95,6 @@ default List getResultList() {
@Override
ProcedureCallImplementor setTimeout(Integer timeout);
- @Override
- ProcedureCallImplementor registerStoredProcedureParameter(int position, Class> type, ParameterMode mode);
-
- @Override
- ProcedureCallImplementor registerStoredProcedureParameter(String parameterName, Class> type, ParameterMode mode);
-
@Override
NamedCallableQueryMemento toMemento(String name);
}
diff --git a/hibernate-core/src/main/java/org/hibernate/query/procedure/ProcedureParameter.java b/hibernate-core/src/main/java/org/hibernate/query/procedure/ProcedureParameter.java
index 50c085fce752..a4efd3b44ea2 100644
--- a/hibernate-core/src/main/java/org/hibernate/query/procedure/ProcedureParameter.java
+++ b/hibernate-core/src/main/java/org/hibernate/query/procedure/ProcedureParameter.java
@@ -23,5 +23,4 @@ public interface ProcedureParameter extends QueryParameter {
* @return The parameter mode.
*/
ParameterMode getMode();
-
}