{"record":{"id":"d6bc0526da7b4fbf","repo":"hibernate/hibernate-orm","slug":"classname-does-not-support-array-literals","errorCode":null,"errorMessage":"{className} does not support array literals","messagePattern":"(.+?) does not support array literals","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java","lineNumber":5152,"sourceCode":"\t\t\treturn maxLength == null\n\t\t\t\t\t? elementTypeName + \" array\"\n\t\t\t\t\t: elementTypeName + \" array[\" + maxLength + \"]\";\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t/**\n\t * Append an array literal with the given elements to the given {@link SqlAppender}.\n\t */\n\tpublic void appendArrayLiteral(\n\t\t\tSqlAppender appender,\n\t\t\tObject[] literal,\n\t\t\tJdbcLiteralFormatter<Object> elementFormatter,\n\t\t\tWrapperOptions wrapperOptions) {\n\t\tif ( !supportsStandardArrays() ) {\n\t\t\tthrow new UnsupportedOperationException( getClass().getName() + \" does not support array literals\" );\n\t\t}\n\t\tappender.appendSql( \"ARRAY[\" );\n\t\tif ( literal.length != 0 ) {\n\t\t\tif ( literal[0] == null ) {\n\t\t\t\tappender.appendSql( \"null\" );\n\t\t\t}\n\t\t\telse {\n\t\t\t\telementFormatter.appendJdbcLiteral( appender, literal[0], this, wrapperOptions );\n\t\t\t}\n\t\t\tfor ( int i = 1; i < literal.length; i++ ) {\n\t\t\t\tappender.appendSql( ',' );\n\t\t\t\tif ( literal[i] == null ) {\n\t\t\t\t\tappender.appendSql( \"null\" );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\telementFormatter.appendJdbcLiteral( appender, literal[i], this, wrapperOptions );\n\t\t\t\t}\n\t\t\t}","sourceCodeStart":5134,"sourceCodeEnd":5170,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java#L5134-L5170","documentation":"Error \"{className} does not support array literals\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Triggered when the application calls a Hibernate dialect feature that the configured database dialect cannot provide: the dialect class does not support array literals.","commonSituations":"Common when running against a database whose dialect lacks this capability, when a mapping or HQL/Criteria query requests unsupported functionality, or when the wrong dialect is configured for the database in use. Error: the dialect class does not support array literals.","solutions":["Pass the array as a bind parameter instead of an inline literal.","Use a dialect that supports array literals."],"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"}