hibernate/hibernate-orm · error · UnsupportedOperationException

Unsupported Jakarta Data restriction type: {}

Error message

Unsupported Jakarta Data restriction type: {}

What it means

Error "Unsupported Jakarta Data restriction type: {}" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/query/restriction/JakartaDataRestriction.java:196

		query.orderBy( orders );
	}

	/**
	 * Obtain a {@linkplain Predicate JPA criteria predicate} representing the given
	 * {@linkplain jakarta.data.restrict.Restriction Jakarta Data restriction}.
	 */
	private static Predicate restriction(
			jakarta.data.restrict.Restriction<?> restriction,
			Root<?> root,
			CriteriaBuilder builder) {
		if ( restriction instanceof BasicRestriction<?, ?> basicRestriction ) {
			return basicRestriction( basicRestriction, root, builder );
		}
		else if ( restriction instanceof CompositeRestriction<?> compositeRestriction ) {
			return compositeRestriction( compositeRestriction, root, builder );
		}
		else {
			throw new UnsupportedOperationException(
					"Unsupported Jakarta Data restriction type: " + restriction.getClass().getName() );
		}
	}

	/**
	 * Obtain a {@linkplain Predicate JPA criteria predicate} representing the given
	 * {@linkplain CompositeRestriction composite Jakarta Data restriction}.
	 */
	private static Predicate compositeRestriction(
			CompositeRestriction<?> compositeRestriction,
			Root<?> root,
			CriteriaBuilder builder) {
		var restrictions = compositeRestriction.restrictions();
		final List<Predicate> list = new ArrayList<>( restrictions.size() );
		for ( var restriction : restrictions ) {
			list.add( restriction( restriction, root, builder ) );
		}
		final var predicates = list.toArray( Predicate[]::new );

View on GitHub (pinned to fad1729dce)

Solutions

  1. The Jakarta Data restriction type is not supported. Use one of the supported restriction types.

When it happens

Trigger: A Jakarta Data restriction is invalid or unsupported: Unsupported Jakarta Data restriction type: <value>

Common situations: Building Restrictions with empty paths, unsupported restriction/constraint/expression types, or expressions of the wrong Java type.


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