hibernate/hibernate-orm · error · IllegalArgumentException
Unsupported aggregate SQL type: {}
Error message
Unsupported aggregate SQL type: {} What it means
Error "Unsupported aggregate SQL type: {}" thrown in hibernate/hibernate-orm.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/dialect/aggregate/OracleAggregateSupport.java:357
if ( SqlTypes.isBinaryType( column.getJdbcMapping().getJdbcType().getDdlTypeCode() ) ) {
return template.replace(
placeholder,
"hextoraw(replace(xmlcast(xmlquery(" + xmlExtractArguments( aggregateParentReadExpression, columnExpression + "/text()" ) + ") as varchar(36)),'-',''))"
);
}
// Fall-through intended
default:
return template.replace(
placeholder,
"xmlcast(xmlquery(" + xmlExtractArguments( aggregateParentReadExpression, columnExpression + "/text()" ) + ") as " + getNarrowCastTypeName( column, typeConfiguration ) + ")"
);
}
case STRUCT:
case STRUCT_ARRAY:
case STRUCT_TABLE:
return template.replace( placeholder, aggregateParentReadExpression + "." + columnExpression );
}
throw new IllegalArgumentException( "Unsupported aggregate SQL type: " + aggregateColumnTypeCode );
}
private static WrapperOptions getWrapperOptions(TypeConfiguration typeConfiguration) {
try {
return typeConfiguration.getWrapperOptions();
}
catch (HibernateException e) {
// before we have a SessionFactory, no useful WrapperOptions to pass
return null;
}
}
private static String xmlExtractArguments(String aggregateParentReadExpression, String xpathFragment) {
final String extractArguments;
int separatorIndex;
if ( aggregateParentReadExpression.startsWith( XML_EXTRACT_START )
&& aggregateParentReadExpression.endsWith( XML_EXTRACT_END )
&& (separatorIndex = aggregateParentReadExpression.indexOf( XML_EXTRACT_SEPARATOR )) != -1 ) {View on GitHub (pinned to fad1729dce)
Solutions
- Map the aggregate column with a supported SQL type.
- Avoid the unsupported aggregate type on Oracle.
When it happens
Trigger: Triggered when the application calls a Hibernate dialect feature that the configured database dialect cannot provide: Unsupported aggregate SQL type (Oracle).
Common situations: 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).
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/2e1fd0b64c833671.
Report an issue: GitHub.