hibernate/hibernate-orm · error · IllegalArgumentException
Argument assigned to filter parameter '{}' is not of type '{
Error message
Argument assigned to filter parameter '{}' is not of type '{}' What it means
Error "Argument assigned to filter parameter '{}' is not of type '{}'" thrown in hibernate/hibernate-orm.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/internal/FilterImpl.java:115
/**
* Set the named parameter's value for this filter.
*
* @param name The parameter's name.
* @param value The value to be applied.
* @return This FilterImpl instance (for method chaining).
* @throws IllegalArgumentException Indicates that either the parameter was undefined or that the type
* of the passed value did not match the configured type.
*/
public Filter setParameter(String name, Object value) throws IllegalArgumentException {
final Object argument = definition.processArgument( value );
// Make sure this is a defined parameter and check the incoming value type
final var type = definition.getParameterJdbcMapping( name );
if ( type == null ) {
throw new IllegalArgumentException( "Undefined filter parameter '" + name + "'" );
}
if ( argument != null && !type.getJavaTypeDescriptor().isInstance( argument ) ) {
throw new IllegalArgumentException( "Argument assigned to filter parameter '" + name
+ "' is not of type '" + type.getJavaTypeDescriptor().getTypeName() + "'" );
}
if ( parameters == null ) {
parameters = new TreeMap<>();
}
parameters.put( name, argument );
validated = false;
return this;
}
/**
* Set the named parameter's value list for this filter. Used
* in conjunction with IN-style filter criteria.
*
* @param name The parameter's name.
* @param values The values to be expanded into an SQL IN list.
* @return This FilterImpl instance (for method chaining).
*/View on GitHub (pinned to fad1729dce)
Solutions
- Pass an argument whose type matches the filter parameter's declared type.
When it happens
Trigger: Thrown when a supplied argument's Java type does not match the type expected by the mapping or parameter definition.
Common situations: Typical situations: passing an id of the wrong Java type; binding a filter/query parameter with an incompatible value; generic type erasure hiding a wrong argument type.
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/d54621df32b57496.
Report an issue: GitHub.