{"record":{"id":"23e02229359f3471","repo":"hibernate/hibernate-orm","slug":"cannot-determine-the-bindable-type-for-procedure-p","errorCode":null,"errorMessage":"Cannot determine the bindable type for procedure parameter %s (%s)","messagePattern":"Cannot determine the bindable type for procedure parameter (.+?) \\((.+?)\\)","errorType":"exception","errorClass":"ParameterTypeException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureParameterImpl.java","lineNumber":215,"sourceCode":"\t\t\t\t: null;\n\t}\n\n\tprivate void validateBindableType(BindableType<T> bindableType, int startIndex) {\n\t\tif ( bindableType == null ) {\n\t\t\tthrow new ParameterTypeException(\n\t\t\t\t\tString.format(\n\t\t\t\t\t\t\tLocale.ROOT,\n\t\t\t\t\t\t\t\"Could not determine ProcedureCall parameter bind type - %s (%s)\",\n\t\t\t\t\t\t\tthis.name != null ? this.name : this.position,\n\t\t\t\t\t\t\tstartIndex\n\t\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate JdbcParameterBinder getParameterBinder(BindableType<T> typeToUse, String name) {\n\t\tif ( typeToUse == null ) {\n\t\t\tthrow new ParameterTypeException(\n\t\t\t\t\tString.format(\n\t\t\t\t\t\t\tLocale.ROOT,\n\t\t\t\t\t\t\t\"Cannot determine the bindable type for procedure parameter %s (%s)\",\n\t\t\t\t\t\t\tthis.name != null ? this.name : this.position,\n\t\t\t\t\t\t\tname\n\t\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\telse if ( typeToUse instanceof BasicType<?> basicType ) {\n\t\t\treturn new JdbcParameterImpl( basicType );\n\t\t}\n\t\telse {\n\t\t\tthrow new UnsupportedOperationException();\n\t\t}\n\t}\n\n\tprivate boolean canDoNameParameterBinding(\n\t\t\tBindableType<?> hibernateType,","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureParameterImpl.java#L197-L233","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nProcedureCall call = session.createStoredProcedureCall(\"sync_order\");\ncall.registerParameter(\"mode\", null, ParameterMode.IN); // null type\n\n// after\ncall.registerParameter(\"mode\", String.class, ParameterMode.IN);","handlingStrategy":"validation","validationCode":"// Hibernate 6+ requires an explicit bindable type for every procedure parameter\nObjects.requireNonNull(type, \"Explicit type required for procedure parameter \" + name);\ncall.registerParameter(name, type, ParameterMode.IN);","typeGuard":null,"tryCatchPattern":"try {\n    call.execute();\n} catch (org.hibernate.query.ParameterTypeException e) {\n    // a registration lacked a resolvable type: report the parameter and re-register with an explicit Class/BasicType\n}","preventionTips":["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"],"tags":["hibernate","stored-procedure","parameter-binding","type-resolution"],"backgroundTag":"procedure-parameter-type-unresolved","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}