hibernate/hibernate-orm · error · FunctionArgumentException

Function %s() allows at most %d arguments, but %d arguments

Error message

Function %s() allows at most %d arguments, but %d arguments given

What it means

Error "Function %s() allows at most %d arguments, but %d arguments given" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/query/sqm/produce/function/StandardArgumentsValidators.java:156

						sig.append(i);
					}
				}
				sig.append(")");
				return sig.toString();
			}

		};
	}

	public static ArgumentsValidator max(int maxNumOfArgs) {
		return new ArgumentsValidator() {
			@Override
			public void validate(
					List<? extends SqmTypedNode<?>> arguments,
					String functionName,
					BindingContext bindingContext) {
				if ( arguments.size() > maxNumOfArgs ) {
					throw new FunctionArgumentException(
							String.format(
									Locale.ROOT,
									"Function %s() allows at most %d arguments, but %d arguments given",
									functionName,
									maxNumOfArgs,
									arguments.size()
							)
					);
				}
			}

			@Override
			public String getSignature() {
				final var sig = new StringBuilder("([");
				for (int i=0; i<maxNumOfArgs; i++) {
					if (i!=0) {
						sig.append(", ");
					}

View on GitHub (pinned to fad1729dce)

Solutions

  1. Too many arguments were given for the function.
  2. Reduce the argument count to at most the allowed maximum.

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/890c14fc61667e23. Report an issue: GitHub.