hibernate/hibernate-orm · error · UnsupportedOperationException
Summarization is not supported by DBMS
Error message
Summarization is not supported by DBMS
What it means
MappedByTableGroup represents the inverse side of a mappedBy association (classic one-to-one inverse). Its resolveTableReference delegates to the underlying table group and throws UnknownTableReferenceException when the requested table expression is not reachable through the mapped-by side - i.e. the table you need belongs to the owning side (or a secondary table of it) that this inverse group does not expose.
Source
Thrown at hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CockroachLegacySqlAstTranslator.java:186
}
@Override
public void visitOffsetFetchClause(QueryPart queryPart) {
if ( !isRowNumberingCurrentQueryPart() ) {
renderLimitOffsetClause( queryPart );
}
}
@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 );
}
}
@Override
public void visitLikePredicate(LikePredicate likePredicate) {
// Custom implementation because CockroachDB uses backslash as default escape character
likePredicate.getMatchExpression().accept( this );
if ( likePredicate.isNegated() ) {
appendSql( " not" );
}
if ( likePredicate.isCaseSensitive() ) {
appendSql( " like " );
}
else {
appendSql( WHITESPACE );View on GitHub (pinned to fad1729dce)
Solutions
- Traverse from the owning side of the one-to-one instead of the mappedBy side for columns of the owner's tables.
- Restructure the mapping: make the side you query from the owner (move the FK / drop mappedBy on that direction).
- Join the owning entity explicitly so its tables are in a real table group.
- Upgrade Hibernate - mapped-by table-group resolution has had multiple fixes; report if reproducible.
Example fix
// before: resolving owner-side columns through the inverse (mappedBy) side "select p from Profile p join p.user u order by u.lastLoginAt" // p.user is mappedBy on User // after: query from the owner side directly "select u from User u join u.profile p order by u.lastLoginAt"
Defensive patterns
Strategy: try-catch
Try / catch
try {
return em.createQuery(hql, type).getResultList();
} catch ( UnknownTableReferenceException e ) {
// owner-side table requested through mappedBy side: query from the owner instead
return em.createQuery(invertOneToOneNavigation(hql), type).getResultList();
} Prevention
- Query one-to-one relations from the owning side whenever owner-table columns are selected or ordered.
- Design one-to-one mappings so the side you query most owns the FK (avoid mappedBy on the hot path).
- Cover both navigation directions of every @OneToOne in integration tests.
When it happens
Trigger: Navigating a one-to-one mappedBy association and then resolving a table (owner's primary/secondary table) through the mapped-by table group: ordering or selecting owner-side columns via the inverse path, join conditions built on owner tables, inheritance on the owning entity.
Common situations: @OneToOne(mappedBy=...) mappings where queries dereference from the inverse side; refactors moving the FK; long-standing Hibernate one-to-one inverse resolution bugs reappearing after upgrades; secondary tables on the owning entity.
Related errors
- Unsupported unit: " + unit
- unsupported temporal unit for CUBRID: " + unit
- Summarization is not supported by DBMS!
- Can't emulate '" + tableJoin.getJoinType().getText() + "join
- Property '${property}' uses one-to-one mapping with mappedBy
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/a0e9f7c2f2296a1b.
Report an issue: GitHub.