{"record":{"id":"70bc589874c4a9ee","repo":"hibernate/hibernate-orm","slug":"parameter-d-of-function-s-has-type-s-but-70bc58","errorCode":null,"errorMessage":"Parameter %d of function '%s()' has type '%s', but argument is of type '%s' mapped to '%s'","messagePattern":"Parameter (.+?) of function '(.+?)\\(\\)' has type '(.+?)', but argument is of type '(.+?)' mapped to '(.+?)'","errorType":"exception","errorClass":"FunctionArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/sqm/produce/function/ArgumentTypesValidator.java","lineNumber":282,"sourceCode":"\t\t\tdefault -> true; // TODO: should we throw here?\n\t\t};\n\t}\n\n\tprivate static void throwError(\n\t\t\tFunctionParameterType type, Type javaType, String sqlType, String functionName, int paramNumber) {\n\t\tif ( sqlType == null ) {\n\t\t\tthrow new FunctionArgumentException(\n\t\t\t\t\tString.format(\n\t\t\t\t\t\t\t\"Parameter %d of function '%s()' has type '%s', but argument is of type '%s'\",\n\t\t\t\t\t\t\tparamNumber,\n\t\t\t\t\t\t\tfunctionName,\n\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\tjavaType.getTypeName()\n\t\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\telse {\n\t\t\tthrow new FunctionArgumentException(\n\t\t\t\t\tString.format(\n\t\t\t\t\t\t\t\"Parameter %d of function '%s()' has type '%s', but argument is of type '%s' mapped to '%s'\",\n\t\t\t\t\t\t\tparamNumber,\n\t\t\t\t\t\t\tfunctionName,\n\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\tjavaType.getTypeName(),\n\t\t\t\t\t\t\tsqlType\n\t\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate static void throwTupleError(\n\t\t\tFunctionParameterType type, String functionName, int paramNumber) {\n\t\tthrow new FunctionArgumentException(\n\t\t\t\tString.format(\n\t\t\t\t\t\t\"Parameter %d of function '%s()' has type '%s', but argument is a tuple\",\n\t\t\t\t\t\tparamNumber,","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/sqm/produce/function/ArgumentTypesValidator.java#L264-L300","documentation":"Error \"Parameter %d of function '%s()' has type '%s', but argument is of type '%s' mapped to '%s'\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A function call in a query supplies arguments that violate the function's signature.","commonSituations":"Passing the wrong number or types of arguments (e.g. untyped nulls, tuples) to HQL/SQL functions.","solutions":["The argument's mapped type does not match the function parameter's declared type.","Cast the argument to the required type or pass a value of the correct mapped type."],"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"}