Empty SQL statements with custom UniqueDelegate

Description

hibernate-core 4.1.10 introduced org.hibernate.dialect.unique.UniqueDelegate to handle creation of unique constraints. If you implement a custom UniqueDelegate (e.g. one that creates the unique constraints directly in the column or table definition, like earlier versions of hibernate did), the resulting DDL script may contain empty SQL statements, which most databases cannot handle.
This happens if the custom UniqueDelegate implementation returns an empty String on UniqueDelegate.applyUniquesOnAlter(UniqueKey) or UniqueDelegate.dropUniquesOnAlter(UniqueKey).
org.hibernate.metamodel.relational.UniqueKey should check the return values of that methods and return a String array of length 0 if the String is empty or null.

Environment

None

Status

Assignee

Brett Meyer

Reporter

Barney

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Minor
Configure