hibernate/hibernate-orm · error · UnsupportedOperationException
Not yet implemented
Error message
Not yet implemented
What it means
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.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/query/sqm/tuple/internal/AnonymousTupleTableGroupProducer.java:354
return offset - originalOffset;
}
@Override
public boolean hasPartitionedSelectionMapping() {
return false;
}
//--------------------------------
// Support for using the anonymous tuple as table reference directly somewhere is not yet implemented
//--------------------------------
@Override
public <T> DomainResult<T> createDomainResult(
NavigablePath navigablePath,
TableGroup tableGroup,
String resultVariable,
DomainResultCreationState creationState) {
throw new UnsupportedOperationException( "Not yet implemented" );
}
@Override
public void applySqlSelections(
NavigablePath navigablePath,
TableGroup tableGroup,
DomainResultCreationState creationState) {
throw new UnsupportedOperationException( "Not yet implemented" );
}
@Override
public void applySqlSelections(
NavigablePath navigablePath,
TableGroup tableGroup,
DomainResultCreationState creationState,
BiConsumer<SqlSelection, JdbcMapping> selectionConsumer) {
throw new UnsupportedOperationException( "Not yet implemented" );
}View on GitHub (pinned to fad1729dce)
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
Example fix
// before
JpaCteCriteria<Tuple> cte = query.with("t", tupleQuery);
query.select(cteAttributePathAsTuple); // tuple used as direct reference -> 'Not yet implemented'
// after — select component attributes of the CTE root
Root<Tuple> t = (Root<Tuple>) query.from(cte);
query.multiselect(t.get("id"), t.get("amount")); // routed through component model parts Defensive patterns
Strategy: fallback
Validate before calling
// No pre-check available from user code; keep query shapes on supported paths: // select component attributes of the tuple/CTE instead of the tuple itself as a table reference
Try / catch
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; } Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Only embeddables without collections are supported!
- AnonymousTupleEmbeddableValuedModelPart is not fetchable
- Anonymous tuple path source does not have a declaring type
- Unsupported path source: ${domainType}
- Unsupported path source: ${sqmPathType}
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/16585de115afdcb2.
Report an issue: GitHub.