hibernate/hibernate-orm · error · UnsupportedOperationException

Summarization is not supported by DBMS!

Error message

Summarization is not supported by DBMS!

What it means

The model-part variant of DerivedTableReference.resolveTableReference: same unconditional UnknownTableReferenceException, thrown when a ValuedModelPart's containing table is requested relative to a derived (subquery/VALUES/lateral) table reference. A derived table has exactly its derived columns and no base tables, so any model-part-to-physical-table resolution against it is a translation-path error.

Source

Thrown at hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CacheSqlAstTranslator.java:97

	@Override
	protected void renderSelectTupleComparison(
			List<SqlSelection> lhsExpressions,
			SqlTuple tuple,
			ComparisonOperator operator) {
		emulateSelectTupleComparison( lhsExpressions, tuple.getExpressions(), operator, true );
	}

	@Override
	protected void renderPartitionItem(Expression expression) {
		if ( expression instanceof Literal ) {
			appendSql( "'0' || '0'" );
		}
		else if ( expression instanceof Summarization ) {
			// This could theoretically be emulated by rendering all grouping variations of the query and
			// connect them via union all but that's probably pretty inefficient and would have to happen
			// on the query spec level
			throw new UnsupportedOperationException( "Summarization is not supported by DBMS!" );
		}
		else {
			expression.accept( this );
		}
	}
}

View on GitHub (pinned to fad1729dce)

Solutions

  1. Avoid model-part column resolution through derived references: join the real owning entity instead.
  2. For subselect-mapped entities, ensure no inheritance/locking features force physical table resolution.
  3. Move the derived part into a CTE backed by real tables on dialects that support it.
  4. Upgrade Hibernate and report the query if resolution should have stayed at the derived level.
Defensive patterns

Strategy: try-catch

Try / catch

try {
    return query.getResultList();
} catch ( UnknownTableReferenceException e ) {
    if ( e.getMessage() != null && e.getMessage().contains("DerivedTableReferences") ) {
        // join the real owning entity instead of resolving model parts through the derived reference
        return em.createQuery(replaceDerivedPathWithJoin(hql), type).getResultList();
    }
    throw e;
}

Prevention

When it happens

Trigger: SQM paths over derived from-elements (subselect entities, VALUES lists, laterals) where later translation needs the physical table of a model part - locking, id-column resolution, subclass table lookup - and calls this overload on the DerivedTableReference.

Common situations: @Subselect/@Synchronize entities with polymorphic subclasses or id resolution requiring base tables; lateral joins on databases with derived-path restrictions; custom translators routing model-part resolution into derived references.

Related errors


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/8cb3a38e82d612b2. Report an issue: GitHub.