hibernate/hibernate-orm · error · IllegalStateException

Couldn't find table index for [${tableExpression}] in: ${dec

Error message

Couldn't find table index for [${tableExpression}] in: ${declaringEntityPersister.getEntityName()}

What it means

Error "Couldn't find table index for [${tableExpression}] in: ${declaringEntityPersister.getEntityName()}" thrown in hibernate/hibernate-orm.

Source

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

				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. The table expression could not be matched to a table of the entity persister.
  2. Check that the table name used in the mutation matches the entity's mapped tables.

When it happens

Trigger: A name referenced in the query or its configuration cannot be resolved at runtime.

Common situations: Typos in fetch-profile, memento, or table names, or references to objects that were never registered.


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