{"record":{"id":"71aedbf3145bf6e9","repo":"hibernate/hibernate-orm","slug":"function-s-requires-at-least-d-arguments-but","errorCode":null,"errorMessage":"Function %s() requires at least %d arguments, but only %d arguments given","messagePattern":"Function (.+?)\\(\\) requires at least (.+?) arguments, but only (.+?) arguments given","errorType":"exception","errorClass":"FunctionArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/sqm/produce/function/StandardArgumentsValidators.java","lineNumber":80,"sourceCode":"\n\t\t@Override\n\t\tpublic String getSignature() {\n\t\t\treturn \"()\";\n\t\t}\n\t};\n\n\tpublic static ArgumentsValidator min(int minNumOfArgs) {\n\t\tif (minNumOfArgs<1) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\treturn new ArgumentsValidator() {\n\t\t\t@Override\n\t\t\tpublic void validate(\n\t\t\t\t\tList<? extends SqmTypedNode<?>> arguments,\n\t\t\t\t\tString functionName,\n\t\t\t\t\tBindingContext bindingContext) {\n\t\t\t\tif ( arguments.size() < minNumOfArgs ) {\n\t\t\t\t\tthrow new FunctionArgumentException(\n\t\t\t\t\t\t\tString.format(\n\t\t\t\t\t\t\t\t\tLocale.ROOT,\n\t\t\t\t\t\t\t\t\t\"Function %s() requires at least %d arguments, but only %d arguments given\",\n\t\t\t\t\t\t\t\t\tfunctionName,\n\t\t\t\t\t\t\t\t\tminNumOfArgs,\n\t\t\t\t\t\t\t\t\targuments.size()\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic String getSignature() {\n\t\t\t\tfinal var sig = new StringBuilder(\"(\");\n\t\t\t\tfor (int i=0; i<minNumOfArgs; i++) {\n\t\t\t\t\tif (i!=0) {\n\t\t\t\t\t\tsig.append(\", \");\n\t\t\t\t\t}","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/sqm/produce/function/StandardArgumentsValidators.java#L62-L98","documentation":"Error \"Function %s() requires at least %d arguments, but only %d arguments given\" 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":["Too few arguments were given for the function.","Supply at least the required number of arguments for the function call."],"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"}