{"record":{"id":"c2caa1fde060e5f9","repo":"hibernate/hibernate-orm","slug":"summarization-is-not-supported-by-dbms-c2caa1","errorCode":null,"errorMessage":"Summarization is not supported by DBMS!","messagePattern":"Summarization is not supported by DBMS!","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CUBRIDSqlAstTranslator.java","lineNumber":59,"sourceCode":"\n\t@Override\n\tprotected void renderSelectTupleComparison(\n\t\t\tList<SqlSelection> lhsExpressions,\n\t\t\tSqlTuple tuple,\n\t\t\tComparisonOperator operator) {\n\t\temulateSelectTupleComparison( lhsExpressions, tuple.getExpressions(), operator, true );\n\t}\n\n\t@Override\n\tprotected void renderPartitionItem(Expression expression) {\n\t\tif ( expression instanceof Literal ) {\n\t\t\tappendSql( \"'0' || '0'\" );\n\t\t}\n\t\telse if ( expression instanceof Summarization ) {\n\t\t\t// This could theoretically be emulated by rendering all grouping variations of the query and\n\t\t\t// connect them via union all but that's probably pretty inefficient and would have to happen\n\t\t\t// on the query spec level\n\t\t\tthrow new UnsupportedOperationException( \"Summarization is not supported by DBMS!\" );\n\t\t}\n\t\telse {\n\t\t\texpression.accept( this );\n\t\t}\n\t}\n}\n","sourceCodeStart":41,"sourceCodeEnd":66,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CUBRIDSqlAstTranslator.java#L41-L66","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Join explicitly to the entity/table that owns the attribute before referencing it.","Query the concrete subclass whose table group actually contains the named table.","Review inheritance and secondary-table mappings named in the exception for correctness after refactors.","Upgrade to the latest 7.x - model-part-based resolution gaps are actively patched; report HHH if reproducible."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    return em.createQuery(hql, type).getResultList();\n} catch ( UnknownTableReferenceException e ) {\n    // e.g. subclass/secondary table missing from the group: query the concrete subclass or join the owner\n    return fallbackQueryForConcreteSubclass( e );\n}","preventionTips":["In polymorphic hierarchies, select and order only attributes guaranteed present in every branch (or query concrete subclasses).","Verify secondary-table and inheritance mappings after any schema refactor by translating all named queries at startup.","Avoid referencing the inverse side of mappedBy one-to-one relations for owner-table columns; join the owner instead."],"tags":["sql","table-reference","model-part","mapping","sql-ast"],"backgroundTag":"unknown-table-reference","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}