{"record":{"id":"dc6b3997c3a7158f","repo":"hibernate/hibernate-orm","slug":"unique-constraint-name-on-table-table-ha-dc6b39","errorCode":null,"errorMessage":"Unique constraint '${name}' on table '${table}' has an empty column name","messagePattern":"Unique constraint '(.+?)' 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":147,"sourceCode":"\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];\n\t\t\tif ( isEmpty( columnName ) ) {\n\t\t\t\tthrow new AnnotationException( \"Unique constraint\"\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] = column( table, columnName );\n\t\t}\n\t\treturn columns;\n\t}\n\n\tprivate void createIndexOrUniqueKey(\n\t\t\tTable table,\n\t\t\tString originalKeyName,\n\t\t\tboolean nameExplicit,\n\t\t\tString[] columnNames,\n\t\t\tString[] orderings,\n\t\t\tboolean unique,\n\t\t\tboolean declaredAsIndex,\n\t\t\tString type,\n\t\t\tString using,","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/IndexBinder.java#L129-L165","documentation":"Error \"Unique constraint '${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 unique constraint 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"}