{"record":{"id":"f63636d879a72bf5","repo":"hibernate/hibernate-orm","slug":"xml-array-in-is-not-supported-with-legac","errorCode":null,"errorMessage":"XML array '{}' in '{}' is not supported with legacy format enabled.","messagePattern":"XML array '(.+?)' in '(.+?)' is not supported with legacy format enabled\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/dialect/aggregate/OracleAggregateSupport.java","lineNumber":330,"sourceCode":"\t\t\t\t\t\t\t\tplaceholder,\n\t\t\t\t\t\t\t\t\"to_timestamp(xmlcast(xmlquery(\" + xmlExtractArguments( aggregateParentReadExpression, columnExpression + \"/text()\" ) + \") as varchar(35)),'YYYY-MM-DD\\\"T\\\"hh24:mi:ss.FF9')\"\n\t\t\t\t\t\t);\n\t\t\t\t\tcase TIMESTAMP_WITH_TIMEZONE:\n\t\t\t\t\tcase TIMESTAMP_UTC:\n\t\t\t\t\t\treturn template.replace(\n\t\t\t\t\t\t\t\tplaceholder,\n\t\t\t\t\t\t\t\t\"to_timestamp_tz(xmlcast(xmlquery(\" + xmlExtractArguments( aggregateParentReadExpression, columnExpression + \"/text()\" ) + \") as varchar(35)),'YYYY-MM-DD\\\"T\\\"hh24:mi:ss.FF9TZH:TZM')\"\n\t\t\t\t\t\t);\n\t\t\t\t\tcase ARRAY:\n\t\t\t\t\t\tthrow new UnsupportedOperationException( \"Transforming XML_ARRAY to native arrays is not supported on Oracle!\" );\n\t\t\t\t\tcase SQLXML:\n\t\t\t\t\t\treturn template.replace(\n\t\t\t\t\t\t\t\tplaceholder,\n\t\t\t\t\t\t\t\tXML_EXTRACT_START + xmlExtractArguments( aggregateParentReadExpression, columnExpression + \"/*\" ) + \"))\"\n\t\t\t\t\t\t);\n\t\t\t\t\tcase XML_ARRAY:\n\t\t\t\t\t\tif ( typeConfiguration.getCurrentBaseSqlTypeIndicators().isXmlFormatMapperLegacyFormatEnabled() ) {\n\t\t\t\t\t\t\tthrow new IllegalArgumentException( \"XML array '\" + columnExpression + \"' in '\" + aggregateParentReadExpression + \"' is not supported with legacy format enabled.\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\treturn template.replace(\n\t\t\t\t\t\t\t\t\tplaceholder,\n\t\t\t\t\t\t\t\t\t\"xmlelement(\\\"Collection\\\",xmlquery(\" + xmlExtractArguments( aggregateParentReadExpression, columnExpression + \"/*\" ) + \"))\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\tcase UUID:\n\t\t\t\t\t\tif ( SqlTypes.isBinaryType( column.getJdbcMapping().getJdbcType().getDdlTypeCode() ) ) {\n\t\t\t\t\t\t\treturn template.replace(\n\t\t\t\t\t\t\t\t\tplaceholder,\n\t\t\t\t\t\t\t\t\t\"hextoraw(replace(xmlcast(xmlquery(\" + xmlExtractArguments( aggregateParentReadExpression, columnExpression + \"/text()\" ) + \") as varchar(36)),'-',''))\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Fall-through intended\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn template.replace(\n\t\t\t\t\t\t\t\tplaceholder,","sourceCodeStart":312,"sourceCodeEnd":348,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/dialect/aggregate/OracleAggregateSupport.java#L312-L348","documentation":"Error \"XML array '{}' in '{}' is not supported with legacy format enabled.\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Triggered when the application calls a Hibernate dialect feature that the configured database dialect cannot provide: XML array is not supported with legacy format enabled (Oracle).","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: XML array is not supported with legacy format enabled (Oracle).","solutions":["Disable legacy XML format.","Avoid XML array aggregates on Oracle."],"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"}