{"record":{"id":"b7edb77ce303d16e","repo":"hibernate/hibernate-orm","slug":"index-name-on-table-table-has-an-empty-c","errorCode":null,"errorMessage":"Index '${name}' on table '${table}' has an empty column name","messagePattern":"Index '(.+?)' on table '(.+?)' has an empty column name","errorType":"exception","errorClass":"AnnotationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/internal/IndexBinder.java","lineNumber":127,"sourceCode":"\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;\n\t\tif ( size == 0 ) {\n\t\t\tthrow new AnnotationException( \"Unique constraint\"\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 Column[] columns = new Column[size];\n\t\tfor ( int index = 0; index < size; index++ ) {\n\t\t\tfinal String columnName = columnNames[index];","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/IndexBinder.java#L109-L145","documentation":"Error \"Index '${name}' on table '${table}' has an empty column name\" 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":["Replace the empty column name in the index with a valid column name."],"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"}