Please see
HHH-8092
and
HHH-8162
, then re-try your test case in 4.2.1 or later.
HHH-8092
specifically should fix what you're seeing.
Note that you're misunderstanding how dialect.getUniqueDelegate().applyUniqueToColumn( col ) works. See the UniqueDelegate interface's javadocs. applyUniqueToColumn is relevant only to Dialects that do not support adding a constraint through an "alter table" statement, so it returns empty string by default.
|