hibernate/hibernate-orm · error · ParameterTypeException
Cannot determine the bindable type for procedure parameter %
Error message
Cannot determine the bindable type for procedure parameter %s (%s)
What it means
Thrown as ParameterTypeException from ProcedureParameterImpl.getParameterBinder(BindableType,String) when Hibernate cannot resolve a BindableType for a stored-procedure parameter. The resolved type is what builds the JdbcParameterBinder that writes values to the JDBC CallableStatement, so a null BindableType makes binding impossible. The message names the offending parameter (name or position) plus the registration hint it tried.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureParameterImpl.java:215
: null;
}
private void validateBindableType(BindableType<T> bindableType, int startIndex) {
if ( bindableType == null ) {
throw new ParameterTypeException(
String.format(
Locale.ROOT,
"Could not determine ProcedureCall parameter bind type - %s (%s)",
this.name != null ? this.name : this.position,
startIndex
)
);
}
}
private JdbcParameterBinder getParameterBinder(BindableType<T> typeToUse, String name) {
if ( typeToUse == null ) {
throw new ParameterTypeException(
String.format(
Locale.ROOT,
"Cannot determine the bindable type for procedure parameter %s (%s)",
this.name != null ? this.name : this.position,
name
)
);
}
else if ( typeToUse instanceof BasicType<?> basicType ) {
return new JdbcParameterImpl( basicType );
}
else {
throw new UnsupportedOperationException();
}
}
private boolean canDoNameParameterBinding(
BindableType<?> hibernateType,View on GitHub (pinned to fad1729dce)
Solutions
- Pass an explicit Java type for every registration: call.registerParameter("status", Integer.class, ParameterMode.IN)
- For custom value types, register a BasicType first (via @Type on the field or a TypeContributor) so the JavaType resolves to a known BasicType
- Never pass null as the type argument; with the Jakarta API use query.registerStoredProcedureParameter(1, Integer.class, ParameterMode.IN)
- If the type is only known at runtime, resolve it from the MappingMetamodel / a BasicTypeReference and pass the concrete BasicType
Example fix
// before
ProcedureCall call = session.createStoredProcedureCall("sync_order");
call.registerParameter("mode", null, ParameterMode.IN); // null type
// after
call.registerParameter("mode", String.class, ParameterMode.IN); Defensive patterns
Strategy: validation
Validate before calling
// Hibernate 6+ requires an explicit bindable type for every procedure parameter Objects.requireNonNull(type, "Explicit type required for procedure parameter " + name); call.registerParameter(name, type, ParameterMode.IN);
Try / catch
try {
call.execute();
} catch (org.hibernate.query.ParameterTypeException e) {
// a registration lacked a resolvable type: report the parameter and re-register with an explicit Class/BasicType
} Prevention
- Always pass an explicit Class or BasicType when registering procedure parameters
- Register custom value types via @Type or a TypeContributor before using them in procedure calls
- Avoid reflective parameter registration that can pass null types
- Execute each procedure call once in a startup smoke test to fail fast on unresolvable types
When it happens
Trigger: Calling ProcedureCall#registerParameter(name/position, Class<T>, ParameterMode) with a null or unresolvable Class, or building a ProcedureParameterImplementor through internal APIs without a Class, BasicType, or type Name, then letting toJdbcParameterRegistration render the JDBC call at execute()/getOutputs() time.
Common situations: Registering an IN/OUT/INOUT parameter with a null type and expecting the JDBC driver metadata to fill it in (Hibernate 6+ requires an explicit bindable type); using a custom Java value class that has no registered BasicType (no @Type, no TypeContributor); porting legacy org.hibernate.StoredProcedureQuery code where types were optional; reflective wrapper code that registers parameters with a null type argument.
Related errors
- Cannot mix named parameter with positional parameter registr
- Cannot mix positional parameter with named parameter registr
- Named parameter [" + name + "] is not registered with this p
- Positional parameter " + positionLabel + " is not registered
- JDBC driver does not support named parameters for setArray.
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/23e02229359f3471.
Report an issue: GitHub.