{"record":{"id":"90646050c74614c5","repo":"hibernate/hibernate-orm","slug":"index-name-on-table-table-has-no-columns","errorCode":null,"errorMessage":"Index '${name}' on table '${table}' has no columns","messagePattern":"Index '(.+?)' on table '(.+?)' has no columns","errorType":"exception","errorClass":"AnnotationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/internal/IndexBinder.java","lineNumber":119,"sourceCode":"//\t\t\t\t\t\"Table '\" + table.getName() + \"' has no column named '\" + columnName\n//\t\t\t\t\t\t\t+ \"' matching the column specified in '@UniqueConstraint'\"\n//\t\t\t);\n//\t\t}\n\t}\n\n\tprivate Column createColumn(String logicalName) {\n\t\tfinal Database database = getDatabase();\n\t\tfinal String physicalName =\n\t\t\t\tgetPhysicalNamingStrategy()\n\t\t\t\t\t\t.toPhysicalColumnName( database.toIdentifier( logicalName ), database.getJdbcEnvironment() )\n\t\t\t\t\t\t.render( getDialect() );\n\t\treturn new Column( physicalName );\n\t}\n\n\tprivate Selectable[] selectables(Table table, String name, String[] columnNames) {\n\t\tfinal int size = columnNames.length;\n\t\tif ( size == 0 ) {\n\t\t\tthrow new AnnotationException( \"Index\"\n\t\t\t\t\t+ ( isEmpty( name ) ? \"\" : \" '\" + name + \"'\" )\n\t\t\t\t\t+ \" on table '\" + table.getName() + \"' has no columns\" );\n\t\t}\n\t\tfinal Selectable[] columns = new Selectable[size];\n\t\tfor ( int index = 0; index < size; index++ ) {\n\t\t\tfinal String columnName = columnNames[index];\n\t\t\tif ( isEmpty( columnName ) ) {\n\t\t\t\tthrow new AnnotationException( \"Index\"\n\t\t\t\t\t\t+ ( isEmpty( name ) ? \"\" : \" '\" + name + \"'\" )\n\t\t\t\t\t\t+ \" on table '\" + table.getName() + \"' has an empty column name\" );\n\t\t\t}\n\t\t\tcolumns[index] = selectable( table, columnName );\n\t\t}\n\t\treturn columns;\n\t}\n\n\tprivate Column[] columns(Table table, String name, final String[] columnNames) {\n\t\tfinal int size = columnNames.length;","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/IndexBinder.java#L101-L137","documentation":"Error \"Index '${name}' on table '${table}' has no columns\" thrown in hibernate/hibernate-orm.","triggerScenarios":"An @Index or unique constraint declaration has no columns or an empty/unknown column name.","commonSituations":"@Table indexes/uniqueConstraints with an empty columnList or referencing columns that do not exist on the table.","solutions":["Add at least one column to the @Index column list."],"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"}