{"record":{"id":"1d83a28dc9f7bbd1","repo":"hibernate/hibernate-orm","slug":"parameter-d-of-function-s-has-type-s-but-1d83a2","errorCode":null,"errorMessage":"Parameter %d of function '%s()' has type '%s', but argument is a tuple","messagePattern":"Parameter (.+?) of function '(.+?)\\(\\)' has type '(.+?)', but argument is a tuple","errorType":"exception","errorClass":"FunctionArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/sqm/produce/function/ArgumentTypesValidator.java","lineNumber":297,"sourceCode":"\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,\n\t\t\t\t\t\tfunctionName,\n\t\t\t\t\t\ttype\n\t\t\t\t)\n\t\t);\n\t}\n\n\t@Override\n\tpublic String getSignature() {\n\t\tString sig = delegate.getSignature();\n\t\tfor (int i=0; i<types.length; i++) {\n\t\t\tString argName = types.length == 1 ? \"arg\" : \"arg\" + i;\n\t\t\tsig = sig.replace( argName, types[i] + \" \" + argName );\n\t\t}\n\t\treturn sig;\n\t}","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/sqm/produce/function/ArgumentTypesValidator.java#L279-L315","documentation":"Error \"Parameter %d of function '%s()' has type '%s', but argument is a tuple\" 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":["A tuple (multi-valued) expression was passed where the function parameter expects a single value of the given type.","Pass a single-valued expression or select the tuple element you need."],"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"}