hibernate/hibernate-orm · error · FunctionArgumentException

Function %s has no parameters, but %d arguments given

Error message

Function %s has no parameters, but %d arguments given

What it means

Error "Function %s has no parameters, 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:52

			// nothing to do
		}
		@Override
		public String getSignature() {
			return "([arg0[, ...]])";
		}
	};

	/**
	 * Static validator for verifying that we have no arguments
	 */
	public static final ArgumentsValidator NO_ARGS = new ArgumentsValidator() {
		@Override
		public void validate(
				List<? extends SqmTypedNode<?>> arguments,
				String functionName,
				BindingContext bindingContext) {
			if ( !arguments.isEmpty() ) {
				throw new FunctionArgumentException(
						String.format(
								Locale.ROOT,
								"Function %s has no parameters, but %d arguments given",
								functionName,
								arguments.size()
						)
				);
			}
		}

		@Override
		public String getSignature() {
			return "()";
		}
	};

	public static ArgumentsValidator min(int minNumOfArgs) {
		if (minNumOfArgs<1) {

View on GitHub (pinned to fad1729dce)

Solutions

  1. The function takes no parameters, but arguments were supplied.
  2. Call the function with no arguments, e.g. current_date() with no args.

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/63db0fb8cb2f3905. Report an issue: GitHub.