{"record":{"id":"5cc65348e3223e57","repo":"hibernate/hibernate-orm","slug":"could-not-resolve-a-basictype-for-the-java-type","errorCode":null,"errorMessage":"Could not resolve a BasicType for the Java type: \" + resultType.getName()","messagePattern":"Could not resolve a BasicType for the Java type: \" \\+ resultType\\.getName\\(\\)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureCallImpl.java","lineNumber":654,"sourceCode":"\t}\n\n\t@Override\n\t@Nonnull\n\tpublic <T> FunctionReturnImplementor<T> registerResultParameter(@Nonnull Class<T> aClass) {\n\t\tcheckNotClosed();\n\t\t//noinspection resource\n\t\tmarkAsFunctionCall( aClass );\n\t\t//noinspection unchecked\n\t\treturn (FunctionReturnImplementor<T>) functionReturn;\n\t}\n\n\t@Override\n\t@Nonnull\n\tpublic ProcedureCallImplementor<R> markAsFunctionCall(@Nonnull Class<?> resultType) {\n\t\tcheckNotClosed();\n\t\tfinal var basicType = getTypeConfiguration().getBasicTypeForJavaType( resultType );\n\t\tif ( basicType == null ) {\n\t\t\tthrow new IllegalArgumentException( \"Could not resolve a BasicType for the Java type: \" + resultType.getName() );\n\t\t}\n\t\tmarkAsFunctionCall( basicType );\n\t\treturn this;\n\t}\n\n\t@Override\n\t@Nonnull\n\tpublic ProcedureCall markAsFunctionCall(@Nonnull Type<?> typeReference) {\n\t\tcheckNotClosed();\n\t\tif ( !(typeReference instanceof OutputableType<?> outputableType) ) {\n\t\t\tthrow new IllegalArgumentException( \"Given type is not an OutputableType: \" + typeReference );\n\t\t}\n\n\t\tassert !resultSetMappings.isEmpty();\n\t\tfinal var firstResultSetMapping = resultSetMappings.get( 0 );\n\t\tif ( firstResultSetMapping.getNumberOfResultBuilders() == 0 ) {\n\t\t\tfinal var expressible = resolveExpressible( typeReference );\n\t\t\t// Function returns might not be represented as callable parameters,","sourceCodeStart":636,"sourceCodeEnd":672,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureCallImpl.java#L636-L672","documentation":"Error \"Could not resolve a BasicType for the Java type: \" + resultType.getName()\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A name referenced in a mapping, query, or configuration cannot be resolved at runtime.","commonSituations":"Typos in entity/attribute/mapping names, missing mappings, or refactoring without updating references.","solutions":["Register the result class as a managed/basic type, or use a type Hibernate can map natively.","Pass an explicit BasicType or SqlResultSetMapping instead of relying on automatic resolution."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}