hibernate/hibernate-orm · error · IllegalArgumentException

Null value not allowed for multi-valued parameter ':{paramNa

Error message

Null value not allowed for multi-valued parameter ':{paramName}'

What it means

Error "Null value not allowed for multi-valued parameter ':{paramName}'" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/query/internal/AbstractCommonQueryContract.java:1629

		}
		return this;
	}

	@Override
	@Nonnull
	public CommonQueryContractImplementor setProperties(@Nonnull Object bean) {
		final var beanClass = bean.getClass();
		for ( String paramName : getParameterMetadata().getNamedParameterNames() ) {
			try {
				final var getter =
						BuiltInPropertyAccessStrategies.BASIC.getStrategy()
								.buildPropertyAccess( beanClass, paramName, true )
								.getGetter();
				final var returnType = getter.getReturnTypeClass();
				final Object object = getter.get( bean );
				if ( Collection.class.isAssignableFrom( returnType ) ) {
					if ( object == null ) {
						throw new IllegalArgumentException( "Null value not allowed for multi-valued parameter ':" + paramName + "'" );
					}
					setParameterList( paramName, (Collection<?>) object );
				}
				else if ( returnType.isArray() ) {
					if ( object == null ) {
						throw new IllegalArgumentException( "Null value not allowed for array-valued parameter ':" + paramName + "'" );
					}
					setParameterList( paramName, (Object[]) object );
				}
				else {
					setParameter( paramName, object, determineType( paramName, returnType ) );
				}
			}
			catch (PropertyNotFoundException pnfe) {
				// ignore
			}
		}
		return this;

View on GitHub (pinned to fad1729dce)

Solutions

  1. A null value was bound to a multi-valued parameter. Pass a non-null collection (empty if appropriate) for the parameter.

When it happens

Trigger: Null is bound to a collection/array-valued parameter: Null value not allowed for multi-valued parameter ':<value>'

Common situations: Passing a null collection or array (or a collection containing null) to setParameterList()/an IN clause parameter.


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/5cf00f4b6fc3b066. Report an issue: GitHub.