Skip to content

Commit 80938a6

Browse files
committed
HHH-8275 union-subclass generates bad alter table for unique constraint
1 parent 804418b commit 80938a6

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

hibernate-core/src/main/java/org/hibernate/mapping/DenormalizedTable.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,12 @@ public PrimaryKey getPrimaryKey() {
8787

8888
@Override
8989
public Iterator getUniqueKeyIterator() {
90-
//wierd implementation because of hacky behavior
91-
//of Table.sqlCreateString() which modifies the
92-
//list of unique keys by side-effect on some
93-
//dialects
94-
Map uks = new HashMap();
95-
uks.putAll( getUniqueKeys() );
96-
uks.putAll( includedTable.getUniqueKeys() );
97-
return uks.values().iterator();
90+
Iterator iter = includedTable.getUniqueKeyIterator();
91+
while ( iter.hasNext() ) {
92+
UniqueKey uk = (UniqueKey) iter.next();
93+
createUniqueKey( uk.getColumns() );
94+
}
95+
return getUniqueKeys().values().iterator();
9896
}
9997

10098
@Override

0 commit comments

Comments
 (0)