hibernate/hibernate-orm · error · UnsupportedOperationException

Full join emulation requires a table group with selectable…

Error message

Full join emulation requires a table group with selectable columns but got: " + modelPart.getPartName()

What it means

AssertionFailedException in getValuedModelPart: the model part carried by the table group resolved to no valued part with selectable columns (no identifier/key descriptor), which full-join nullness emulation needs.

Solutions

  1. Make sure the full join operates on a table group whose model part exposes selectable columns (an entity or root table group).
  2. Restructure the query so the full join target is an entity root, not an anonymous or derived table group without selectable columns.
  3. Check the FROM clause construction: the full join must reference a mappable entity rather than a computed subquery part.
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Full join emulation encounters a table group whose model part exposes no selectable columns.

Common situations: Full-joining a non-entity or synthetic table group; restrict full joins to entity table groups.


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

Appendix: source

Thrown at hibernate-core/src/main/java/org/hibernate/sql/ast/spi/FullJoinEmulation.java:473

				getValuedModelPart( tableGroup.getModelPart() ),
				true );
	}

	private static ValuedModelPart getValuedModelPart(ModelPartContainer modelPart) {
		if ( modelPart instanceof EntityMappingType mappingType ) {
			return mappingType.getIdentifierMapping();
		}
		else if ( modelPart instanceof EntityValuedModelPart entityValuedModelPart ) {
			return entityValuedModelPart.getEntityMappingType().getIdentifierMapping();
		}
		else if ( modelPart instanceof PluralAttributeMapping pluralAttributeMapping ) {
			return pluralAttributeMapping.getKeyDescriptor();
		}
		else if ( modelPart instanceof ValuedModelPart directValuedModelPart ) {
			return directValuedModelPart;
		}
		else {
			throw new UnsupportedOperationException(
					"Full join emulation requires a table group with selectable columns but got: "
					+ modelPart.getPartName()
			);
		}
	}

	private Predicate createValuedModelPartNullnessPredicate(
			TableGroup tableGroup,
			ValuedModelPart valuedModelPart,
			boolean negated) {
		final List<ColumnReference> columnReferences = new ArrayList<>( valuedModelPart.getJdbcTypeCount() );
		valuedModelPart.forEachSelectable( (selectionIndex, selectableMapping) -> {
			final var tableReference = tableGroup.resolveTableReference(
					tableGroup.getNavigablePath(),
					valuedModelPart,
					selectableMapping.getContainingTableExpression()
			);
			columnReferences.add( new ColumnReference( tableReference, selectableMapping ) );

View on GitHub (pinned to fad1729dce)