Module storm.foundation
Package st.orm
Class AbstractKeyMetamodel<T extends Data,E,V extends @Nullable Object>
java.lang.Object
st.orm.AbstractMetamodel<T,E,V>
st.orm.AbstractKeyMetamodel<T,E,V>
- Type Parameters:
T- the primary table type.E- the field type of the designated element.V- the value type of the designated element.
- All Implemented Interfaces:
Metamodel<T,,E> Metamodel.Key<T,,E> Navigable<T,,E> TypedMetamodel<T,E, V>
public abstract class AbstractKeyMetamodel<T extends Data,E,V extends @Nullable Object>
extends AbstractMetamodel<T,E,V>
implements Metamodel.Key<T,E>
Extension of
AbstractMetamodel that implements Metamodel.Key, indicating that the field has a
uniqueness constraint.
The metamodel processor generates instances of this class for record components annotated with
@UK or @PK (which is meta-annotated with @UK).
- Since:
- 1.9
-
Nested Class Summary
Nested classes/interfaces inherited from interface st.orm.Metamodel
Metamodel.Key<T extends Data,E>, Metamodel.KeyDelegate<T extends Data, E> -
Constructor Summary
ConstructorsModifierConstructorDescriptionAbstractKeyMetamodel(Class<E> fieldType) AbstractKeyMetamodel(Class<E> fieldType, String path) AbstractKeyMetamodel(Class<E> fieldType, String path, String field, boolean inline, @Nullable Metamodel<T, ?> parent) protectedAbstractKeyMetamodel(Class<E> fieldType, String path, String field, boolean inline, @Nullable Metamodel<T, ?> parent, boolean isColumn) AbstractKeyMetamodel(Class<E> fieldType, String path, String field, boolean inline, @Nullable Metamodel<T, ?> parent, boolean isColumn, boolean nullable) Constructs a key metamodel with explicit column and nullable flags. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif this key field allows NULL values with standard SQL distinct-NULL semantics, meaning the UNIQUE constraint does not prevent multiple NULLs.Methods inherited from class st.orm.AbstractMetamodel
equals, field, fieldType, hashCode, isColumn, isInline, path, root, table, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface st.orm.Metamodel
isIdentical, isSame, tableMethods inherited from interface st.orm.Navigable
asMetamodel, canonical, field, fieldPath, fieldType, flatten, isColumn, isInline, path, root, tableTypeMethods inherited from interface st.orm.TypedMetamodel
getValue
-
Constructor Details
-
AbstractKeyMetamodel
-
AbstractKeyMetamodel
-
AbstractKeyMetamodel
-
AbstractKeyMetamodel
-
AbstractKeyMetamodel
public AbstractKeyMetamodel(Class<E> fieldType, String path, String field, boolean inline, @Nullable Metamodel<T, ?> parent, boolean isColumn, boolean nullable) Constructs a key metamodel with explicit column and nullable flags. This constructor is used by the metamodel processor to propagate the nullable status of unique key fields to the runtime.- Parameters:
fieldType- the field type.path- the path to the table.field- the field name.inline- whether this is an inline record field.parent- the parent metamodel.isColumn- whether this metamodel corresponds to a database column.nullable- whether this key allows duplicate NULLs (nullable withnullsDistinct = true).- Since:
- 1.9
-
-
Method Details
-
isNullable
public boolean isNullable()Description copied from interface:Metamodel.KeyReturnstrueif this key field allows NULL values with standard SQL distinct-NULL semantics, meaning the UNIQUE constraint does not prevent multiple NULLs.A nullable key is unsafe for keyset pagination because
WHERE key > cursorsilently excludes NULL rows. Thescrollmethods check this flag and throw aPersistenceExceptionif the key is nullable.- Specified by:
isNullablein interfaceMetamodel.Key<T extends Data,E> - Returns:
trueif this key allows duplicate NULLs (nullable withnullsDistinct = true),falseotherwise.- See Also:
-