hibernate/hibernate-orm · error · UnsupportedOperationException

Unsupported value type: ${value.getClass()}

Error message

Unsupported value type: ${value.getClass()}

What it means

Error "Unsupported value type: ${value.getClass()}" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/SqmMutationStrategyHelper.java:383

			forEachSelectableMapping(
					prefix + "_key",
					any.getKeyDescriptor() != null ? any.getKeyDescriptor() : any.getKeyMapping(),
					consumer
			);
		}
		else if ( value instanceof Component component) {
			final int propertySpan = component.getPropertySpan();
			for ( int i = 0; i < propertySpan; i++ ) {
				final Property property = component.getProperty( i );
				final String newPrefix = component.isEmbedded() ? property.getName() : prefix + "_" + property.getName();
				forEachSelectableMapping( newPrefix, property.getValue(), consumer );
			}
		}
		else if ( value instanceof OneToMany || value instanceof Collection ) {
			// No-op
		}
		else {
			throw new UnsupportedOperationException( "Unsupported value type: " + value.getClass() );
		}
	}

	private static int findTableIndex(EntityPersister declaringEntityPersister, String tableExpression) {
		final String[] tableNames = declaringEntityPersister.getTableNames();
		for ( int i = 0; i < tableNames.length; i++ ) {
			if ( tableExpression.equals( tableNames[i] ) ) {
				return i;
			}
		}
		throw new IllegalStateException( "Couldn't find table index for [" + tableExpression + "] in: " + declaringEntityPersister.getEntityName() );
	}
}

View on GitHub (pinned to fad1729dce)

Solutions

  1. A value of an unsupported type was passed in a mutation statement.
  2. Pass values of mapped/basic types, or add a converter/type mapping for the value class.

When it happens

Trigger: An API operation is invoked on a query object that does not support it.

Common situations: Calling query hint, locking, pagination, conversion, or mutation APIs on a query kind (native vs HQL, select vs mutation) that does not implement them.


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