{"record":{"id":"06c06e2dc7908fb5","repo":"hibernate/hibernate-orm","slug":"couldn-t-find-table-index-for-tableexpression","errorCode":null,"errorMessage":"Couldn't find table index for [${tableExpression}] in: ${declaringEntityPersister.getEntityName()}","messagePattern":"Couldn't find table index for \\[(.+?)\\] in: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/SqmMutationStrategyHelper.java","lineNumber":394,"sourceCode":"\t\t\t\tforEachSelectableMapping( newPrefix, property.getValue(), consumer );\n\t\t\t}\n\t\t}\n\t\telse if ( value instanceof OneToMany || value instanceof Collection ) {\n\t\t\t// No-op\n\t\t}\n\t\telse {\n\t\t\tthrow new UnsupportedOperationException( \"Unsupported value type: \" + value.getClass() );\n\t\t}\n\t}\n\n\tprivate static int findTableIndex(EntityPersister declaringEntityPersister, String tableExpression) {\n\t\tfinal String[] tableNames = declaringEntityPersister.getTableNames();\n\t\tfor ( int i = 0; i < tableNames.length; i++ ) {\n\t\t\tif ( tableExpression.equals( tableNames[i] ) ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\tthrow new IllegalStateException( \"Couldn't find table index for [\" + tableExpression + \"] in: \" + declaringEntityPersister.getEntityName() );\n\t}\n}\n","sourceCodeStart":376,"sourceCodeEnd":397,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/SqmMutationStrategyHelper.java#L376-L397","documentation":"Error \"Couldn't find table index for [${tableExpression}] in: ${declaringEntityPersister.getEntityName()}\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A name referenced in the query or its configuration cannot be resolved at runtime.","commonSituations":"Typos in fetch-profile, memento, or table names, or references to objects that were never registered.","solutions":["The table expression could not be matched to a table of the entity persister.","Check that the table name used in the mutation matches the entity's mapped tables."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}