{"record":{"id":"16585de115afdcb2","repo":"hibernate/hibernate-orm","slug":"not-yet-implemented-16585d","errorCode":null,"errorMessage":"Not yet implemented","messagePattern":"Not yet implemented","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/sqm/tuple/internal/AnonymousTupleTableGroupProducer.java","lineNumber":354,"sourceCode":"\t\treturn offset - originalOffset;\n\t}\n\n\t@Override\n\tpublic boolean hasPartitionedSelectionMapping() {\n\t\treturn false;\n\t}\n\n\t//--------------------------------\n\t// Support for using the anonymous tuple as table reference directly somewhere is not yet implemented\n\t//--------------------------------\n\n\t@Override\n\tpublic <T> DomainResult<T> createDomainResult(\n\t\t\tNavigablePath navigablePath,\n\t\t\tTableGroup tableGroup,\n\t\t\tString resultVariable,\n\t\t\tDomainResultCreationState creationState) {\n\t\tthrow new UnsupportedOperationException( \"Not yet implemented\" );\n\t}\n\n\t@Override\n\tpublic void applySqlSelections(\n\t\t\tNavigablePath navigablePath,\n\t\t\tTableGroup tableGroup,\n\t\t\tDomainResultCreationState creationState) {\n\t\tthrow new UnsupportedOperationException( \"Not yet implemented\" );\n\t}\n\n\t@Override\n\tpublic void applySqlSelections(\n\t\t\tNavigablePath navigablePath,\n\t\t\tTableGroup tableGroup,\n\t\t\tDomainResultCreationState creationState,\n\t\t\tBiConsumer<SqlSelection, JdbcMapping> selectionConsumer) {\n\t\tthrow new UnsupportedOperationException( \"Not yet implemented\" );\n\t}","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/sqm/tuple/internal/AnonymousTupleTableGroupProducer.java#L336-L372","documentation":"AnonymousTupleTableGroupProducer implements the table-group producer interfaces so that tuple-typed results (CTEs, dynamic instantiations) can appear in queries, but using the anonymous tuple directly as a table reference is explicitly unimplemented — the source marks the whole section 'Support for using the anonymous tuple as table reference directly somewhere is not yet implemented'. createDomainResult and both applySqlSelections overloads throw UnsupportedOperationException('Not yet implemented') whenever the SQL-translation machinery tries to produce a domain result / SQL selections straight off the tuple producer.","triggerScenarios":"Writing a query where the anonymous tuple itself is consumed as a table reference by the result-creation machinery — e.g., selecting directly from a CTE/tuple in a position (scalar subselect, set-operation member, certain joins/values contexts) that routes into createDomainResult of the anonymous tuple producer rather than through its component model parts.","commonSituations":"Advanced Hibernate 6 CTE usage (recursive CTEs, union members, value/derived tables), set operations over tuple queries, or migrating native-SQL patterns to SQM; behavior can appear or disappear between 6.x point releases as tuple support is filled in.","solutions":["Restructure the query so selections come from the tuple's component attributes (navigate into the CTE root's parts) instead of using the tuple as a direct table reference","Give the CTE an entity-shaped result (a real @Entity or the CTE type) and select/join that, so domain result creation goes through normal model parts","Search/upgrade the latest Hibernate 6.x and check the Hibernate JIRA (HHH) for the specific tuple-as-table-reference case; if still unimplemented, report your query shape"],"exampleFix":"// before\nJpaCteCriteria<Tuple> cte = query.with(\"t\", tupleQuery);\nquery.select(cteAttributePathAsTuple); // tuple used as direct reference -> 'Not yet implemented'\n\n// after — select component attributes of the CTE root\nRoot<Tuple> t = (Root<Tuple>) query.from(cte);\nquery.multiselect(t.get(\"id\"), t.get(\"amount\")); // routed through component model parts","handlingStrategy":"fallback","validationCode":"// No pre-check available from user code; keep query shapes on supported paths:\n// select component attributes of the tuple/CTE instead of the tuple itself as a table reference","typeGuard":null,"tryCatchPattern":"try { return em.createQuery(query).getResultList(); } catch (UnsupportedOperationException e) { if (\"Not yet implemented\".equals(e.getMessage())) { /* rewrite query selecting tuple components, or switch to entity-typed CTE */ } else throw e; }","preventionTips":["Prefer entity-typed or component-level selections over raw tuple references in CTE queries","Keep advanced CTE/set-operation queries behind integration tests so 'Not yet implemented' surfaces before release","Track Hibernate 6.x releases and the HHH JIRA for tuple-as-table-reference support before upgrading query code"],"tags":["hibernate","not-implemented","tuple","cte","table-reference","sql-generation"],"backgroundTag":"anonymous-tuple-table-reference-unimplemented","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}