hibernate/hibernate-orm · error · FunctionArgumentException
Parameter %d of function '%s()' has type '%s', but argument
Error message
Parameter %d of function '%s()' has type '%s', but argument is of type '%s' mapped to '%s'
What it means
Error "Parameter %d of function '%s()' has type '%s', but argument is of type '%s' mapped to '%s'" thrown in hibernate/hibernate-orm.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/query/sqm/produce/function/ArgumentTypesValidator.java:282
default -> true; // TODO: should we throw here?
};
}
private static void throwError(
FunctionParameterType type, Type javaType, String sqlType, String functionName, int paramNumber) {
if ( sqlType == null ) {
throw new FunctionArgumentException(
String.format(
"Parameter %d of function '%s()' has type '%s', but argument is of type '%s'",
paramNumber,
functionName,
type,
javaType.getTypeName()
)
);
}
else {
throw new FunctionArgumentException(
String.format(
"Parameter %d of function '%s()' has type '%s', but argument is of type '%s' mapped to '%s'",
paramNumber,
functionName,
type,
javaType.getTypeName(),
sqlType
)
);
}
}
private static void throwTupleError(
FunctionParameterType type, String functionName, int paramNumber) {
throw new FunctionArgumentException(
String.format(
"Parameter %d of function '%s()' has type '%s', but argument is a tuple",
paramNumber,View on GitHub (pinned to fad1729dce)
Solutions
- The argument's mapped type does not match the function parameter's declared type.
- Cast the argument to the required type or pass a value of the correct mapped type.
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/70bc589874c4a9ee.
Report an issue: GitHub.