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-aware variant of resolveTableReference: it asks the from-element which physical TableReference hosts a given ValuedModelPart's table expression and throws UnknownTableReferenceException when the part's table is not reachable from this qualifier. Meaning is identical to the string variant - the column's table is missing from the current from-clause element - but the failure surfaces through the model part, so it usually points at association/inheritance mapping mismatches rather than typos.

Source

Thrown at hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CUBRIDSqlAstTranslator.java:59

	@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. Join explicitly to the entity/table that owns the attribute before referencing it.
  2. Query the concrete subclass whose table group actually contains the named table.
  3. Review inheritance and secondary-table mappings named in the exception for correctness after refactors.
  4. Upgrade to the latest 7.x - model-part-based resolution gaps are actively patched; report HHH if reproducible.
Defensive patterns

Strategy: try-catch

Try / catch

try {
    return em.createQuery(hql, type).getResultList();
} catch ( UnknownTableReferenceException e ) {
    // e.g. subclass/secondary table missing from the group: query the concrete subclass or join the owner
    return fallbackQueryForConcreteSubclass( e );
}

Prevention

When it happens

Trigger: Resolving columns of a ValuedModelPart (basic/embedded attribute, fk, id part) whose containing table expression is not part of the table group: subclass table attributes resolved through a superclass table group, secondary tables skipped by join pruning, inverse-side (mappedBy) navigation needing owning-side tables, union-subclass branches missing a member table.

Common situations: Inheritance hierarchies (JOINED/TABLE_PER_CLASS) queried polymorphically while ordering/selecting subclass-specific columns; @OneToOne(mappedBy) traversals; @Subselect or @Synchronize mappings; upgrades that tightened table-reference resolution.

Related errors


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