{"record":{"id":"2e1fd0b64c833671","repo":"hibernate/hibernate-orm","slug":"unsupported-aggregate-sql-type-2e1fd0","errorCode":null,"errorMessage":"Unsupported aggregate SQL type: {}","messagePattern":"Unsupported aggregate SQL type: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/dialect/aggregate/OracleAggregateSupport.java","lineNumber":357,"sourceCode":"\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,\n\t\t\t\t\t\t\t\t\"xmlcast(xmlquery(\" + xmlExtractArguments( aggregateParentReadExpression, columnExpression + \"/text()\" ) + \") as \" + getNarrowCastTypeName( column, typeConfiguration ) + \")\"\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\tcase STRUCT:\n\t\t\tcase STRUCT_ARRAY:\n\t\t\tcase STRUCT_TABLE:\n\t\t\t\treturn template.replace( placeholder, aggregateParentReadExpression + \".\" + columnExpression );\n\t\t}\n\t\tthrow new IllegalArgumentException( \"Unsupported aggregate SQL type: \" + aggregateColumnTypeCode );\n\t}\n\n\tprivate static WrapperOptions getWrapperOptions(TypeConfiguration typeConfiguration) {\n\t\ttry {\n\t\t\treturn typeConfiguration.getWrapperOptions();\n\t\t}\n\t\tcatch (HibernateException e) {\n\t\t\t// before we have a SessionFactory, no useful WrapperOptions to pass\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tprivate static String xmlExtractArguments(String aggregateParentReadExpression, String xpathFragment) {\n\t\tfinal String extractArguments;\n\t\tint separatorIndex;\n\t\tif ( aggregateParentReadExpression.startsWith( XML_EXTRACT_START )\n\t\t\t&& aggregateParentReadExpression.endsWith( XML_EXTRACT_END )\n\t\t\t&& (separatorIndex = aggregateParentReadExpression.indexOf( XML_EXTRACT_SEPARATOR )) != -1 ) {","sourceCodeStart":339,"sourceCodeEnd":375,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/dialect/aggregate/OracleAggregateSupport.java#L339-L375","documentation":"Error \"Unsupported aggregate SQL type: {}\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Triggered when the application calls a Hibernate dialect feature that the configured database dialect cannot provide: Unsupported aggregate SQL type (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: Unsupported aggregate SQL type (Oracle).","solutions":["Map the aggregate column with a supported SQL type.","Avoid the unsupported aggregate type 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"}