We're updating the issue view to help you get more done. 

Inconsistent logic by uses of Dialect#supportsNotNullUnique

Description

Dialect#supportsNotNullUnique is used by 2 areas:

1.) Table. Prevents "not null unique" if supportsNotNullUnique is false and the column is not nullable.
2.) UniqueKey. The logic is reversed from #1. Appears to prevent unique constraints from being created if supportsNotNullUnique is false and one of the constraint's columns is nullable.

The uses seem inconsistent and incorrect.

This came about through HHH-5376, HHH-7579, and HHH-7578. Some dialects appear to differ in their support of "unique not null" and unique constraints on nullable fields. The sole use of supportsNotNullUnique probably won't cut it.

Test case: o.h.test.collection.map.hhh7557.EntityMapTest. All entities have primary keys and explicitly define them as unique and not nullable. The test fails on Oracle as it attempts to use "not null unique" on the column, as well as create a primary key constraint.

Environment

None

Status

Assignee

Brett Meyer

Reporter

Brett Meyer

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

4.3.0.Beta1
4.1.8

Priority

Major