public enum IdValueSource extends Enum<IdValueSource>
Enum Constant and Description |
---|
GENERATED
The id value is generated by the store.
|
NONE
There is no id property, and therefore no id value source.
|
PROVIDED
The id value is provided on the instance.
|
Modifier and Type | Method and Description |
---|---|
static <T> IdValueSource |
forInstance(Object instance,
RelationalPersistentEntity<T> persistentEntity)
Returns the appropriate
IdValueSource for the instance: NONE when the entity has no
id property, PROVIDED when the value of the id property is not null and when it is a
primitive type, not zero, and GENERATED otherwise. |
static IdValueSource |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static IdValueSource[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final IdValueSource PROVIDED
public static final IdValueSource GENERATED
public static final IdValueSource NONE
public static IdValueSource[] values()
for (IdValueSource c : IdValueSource.values()) System.out.println(c);
public static IdValueSource valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static <T> IdValueSource forInstance(Object instance, RelationalPersistentEntity<T> persistentEntity)
IdValueSource
for the instance: NONE
when the entity has no
id property, PROVIDED
when the value of the id property is not null and when it is a
primitive type, not zero, and GENERATED
otherwise.Copyright © 2017–2022 Pivotal Software, Inc.. All rights reserved.