hibernate/hibernate-orm · error · FunctionArgumentException
Function %s() requires at least %d arguments, but only %d ar
Error message
Function %s() requires at least %d arguments, but only %d arguments given
What it means
Error "Function %s() requires at least %d arguments, but only %d arguments given" thrown in hibernate/hibernate-orm.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/query/sqm/produce/function/StandardArgumentsValidators.java:80
@Override
public String getSignature() {
return "()";
}
};
public static ArgumentsValidator min(int minNumOfArgs) {
if (minNumOfArgs<1) {
throw new IllegalArgumentException();
}
return new ArgumentsValidator() {
@Override
public void validate(
List<? extends SqmTypedNode<?>> arguments,
String functionName,
BindingContext bindingContext) {
if ( arguments.size() < minNumOfArgs ) {
throw new FunctionArgumentException(
String.format(
Locale.ROOT,
"Function %s() requires at least %d arguments, but only %d arguments given",
functionName,
minNumOfArgs,
arguments.size()
)
);
}
}
@Override
public String getSignature() {
final var sig = new StringBuilder("(");
for (int i=0; i<minNumOfArgs; i++) {
if (i!=0) {
sig.append(", ");
}View on GitHub (pinned to fad1729dce)
Solutions
- Too few arguments were given for the function.
- Supply at least the required number of arguments for the function call.
When it happens
Trigger: A function call in a query supplies arguments that violate the function's signature.
Common situations: Passing the wrong number or types of arguments (e.g. untyped nulls, tuples) to HQL/SQL functions.
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/71aedbf3145bf6e9.
Report an issue: GitHub.