{"record":{"id":"f424bc1f483aaae4","repo":"hibernate/hibernate-orm","slug":"null-value-not-allowed-for-array-valued-parameter","errorCode":null,"errorMessage":"Null value not allowed for array-valued parameter ':{paramName}'","messagePattern":"Null value not allowed for array-valued parameter ':(.+?)'","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/internal/AbstractCommonQueryContract.java","lineNumber":1635,"sourceCode":"\tpublic CommonQueryContractImplementor setProperties(@Nonnull Object bean) {\n\t\tfinal var beanClass = bean.getClass();\n\t\tfor ( String paramName : getParameterMetadata().getNamedParameterNames() ) {\n\t\t\ttry {\n\t\t\t\tfinal var getter =\n\t\t\t\t\t\tBuiltInPropertyAccessStrategies.BASIC.getStrategy()\n\t\t\t\t\t\t\t\t.buildPropertyAccess( beanClass, paramName, true )\n\t\t\t\t\t\t\t\t.getGetter();\n\t\t\t\tfinal var returnType = getter.getReturnTypeClass();\n\t\t\t\tfinal Object object = getter.get( bean );\n\t\t\t\tif ( Collection.class.isAssignableFrom( returnType ) ) {\n\t\t\t\t\tif ( object == null ) {\n\t\t\t\t\t\tthrow new IllegalArgumentException( \"Null value not allowed for multi-valued parameter ':\" + paramName + \"'\" );\n\t\t\t\t\t}\n\t\t\t\t\tsetParameterList( paramName, (Collection<?>) object );\n\t\t\t\t}\n\t\t\t\telse if ( returnType.isArray() ) {\n\t\t\t\t\tif ( object == null ) {\n\t\t\t\t\t\tthrow new IllegalArgumentException( \"Null value not allowed for array-valued parameter ':\" + paramName + \"'\" );\n\t\t\t\t\t}\n\t\t\t\t\tsetParameterList( paramName, (Object[]) object );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tsetParameter( paramName, object, determineType( paramName, returnType ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (PropertyNotFoundException pnfe) {\n\t\t\t\t// ignore\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\tprotected <T> Type<T> determineType(String namedParam, Class<? extends T> retType) {\n\t\tvar type = getQueryParameterBindings().getBinding( namedParam ).getBindType();\n\t\tif ( type == null ) {\n\t\t\ttype = getParameterMetadata().getQueryParameter( namedParam ).getHibernateType();","sourceCodeStart":1617,"sourceCodeEnd":1653,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/internal/AbstractCommonQueryContract.java#L1617-L1653","documentation":"Error \"Null value not allowed for array-valued parameter ':{paramName}'\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Null is bound to a collection/array-valued parameter: Null value not allowed for array-valued parameter ':<value>'","commonSituations":"Passing a null collection or array (or a collection containing null) to setParameterList()/an IN clause parameter.","solutions":["A null value was bound to an array-valued parameter. Pass a non-null array (empty if appropriate) for the parameter."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}