public enum SharedJoinTableUniqueness extends java.lang.Enum
How a join table that several collections of one owner share keeps the rows of each collection unique, by database.
Such a table has a key column per collection and one element column, or one key column and an element column per collection, and every row leaves the columns of the other collections null. A row is unique by the key column of its own collection and the element, so each collection needs a constraint of its own over those two; one constraint over all key columns would hold a null in every row and reject nothing on a database that treats nulls as distinct. What that per-collection constraint has to look like depends on how the unique index of the database treats a null in its key (UniqueIndexNulls):
COMPARED alone.| Modifiers | Name | Description |
|---|---|---|
interface |
SharedJoinTableUniqueness.Naming |
Names a constraint or index the way the implicit naming strategy of the metadata would. |
| Enum constant | Description |
|---|---|
KEY_PER_COLLECTION |
Where nulls are distinct: a unique key per collection over its key column and the element. |
ONE_KEY_FOR_ALL_COLLECTIONS |
Where nulls are compared: one unique key over the key columns of every collection sharing the table and the element. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public static SharedJoinTableUniqueness |
forDialect(org.hibernate.dialect.Dialect dialect)The uniqueness that fits how the unique index of the dialect's database treats a null in its key. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Enum |
java.lang.Enum#compareTo(java.lang.Enum), java.lang.Enum#compareTo(java.lang.Object), java.lang.Enum#describeConstable(), java.lang.Enum#equals(java.lang.Object), java.lang.Enum#getClass(), java.lang.Enum#getDeclaringClass(), java.lang.Enum#hashCode(), java.lang.Enum#name(), java.lang.Enum#notify(), java.lang.Enum#notifyAll(), java.lang.Enum#ordinal(), java.lang.Enum#toString(), java.lang.Enum#valueOf(java.lang.Class, java.lang.String), java.lang.Enum#wait(), java.lang.Enum#wait(long), java.lang.Enum#wait(long, int) |
Where nulls are distinct: a unique key per collection over its key column and the element.
Where nulls are compared: one unique key over the key columns of every collection sharing the table and the element.
The uniqueness that fits how the unique index of the dialect's database treats a null in its key.