public interface Key
Modifier and Type | Interface and Description |
---|---|
static interface |
Key.Builder
A builder for
Key instances. |
Modifier and Type | Method and Description |
---|---|
<T> Attribute<T> |
attribute()
Returns this keys attribute.
|
List<Attribute<?>> |
attributes() |
Key.Builder |
copyBuilder()
Creates a new
Key.Builder instance, initialized with the values in this key. |
EntityDefinition |
definition() |
<T> T |
get()
Returns the value of this key.
|
<T> T |
get(Attribute<T> attribute) |
<T> Optional<T> |
getOptional()
Returns the value of this key, wrapped in an
Optional . |
<T> Optional<T> |
getOptional(Attribute<T> attribute) |
boolean |
isNotNull() |
boolean |
isNotNull(Attribute<?> attribute)
Returns true if a non-null value is mapped to the given attribute.
|
boolean |
isNull() |
boolean |
isNull(Attribute<?> attribute)
Returns true if a null value is mapped to the given attribute or no mapping exists.
|
boolean |
isPrimaryKey() |
EntityType |
type() |
EntityType type()
EntityDefinition definition()
boolean isPrimaryKey()
boolean isNull()
boolean isNotNull()
boolean isNull(Attribute<?> attribute)
attribute
- the attributeboolean isNotNull(Attribute<?> attribute)
attribute
- the attribute<T> Attribute<T> attribute()
T
- the attribute typeIllegalStateException
- in case this is a composite key or if it contains no attributes<T> T get()
T
- the value typeIllegalStateException
- in case this is a composite key or if it contains no values<T> Optional<T> getOptional()
Optional
. Note that this method throws an exception if this key is a composite key.T
- the value typeOptional
, useful for single attribute keysIllegalStateException
- in case this is a composite key<T> T get(Attribute<T> attribute)
T
- the value typeattribute
- the attribute<T> Optional<T> getOptional(Attribute<T> attribute)
T
- the value typeattribute
- the attributeOptional
Key.Builder copyBuilder()
Key.Builder
instance, initialized with the values in this key.