Class ValueGenerationStrategy
java.lang.Object
org.datanucleus.metadata.ValueGenerationStrategy
- All Implemented Interfaces:
Serializable
Value generation "strategy".
Would have been nice to have this as an enum, but we need to allow for CUSTOM types
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ValueGenerationStrategyThe value "auid" specifies a strategy that is a Java implementation of DCE UUIDs, and represents the results as a 36-character String.static final ValueGenerationStrategyExtension strategy, that will have the "customName" set to the chosen strategy.private StringThe Name of the custom type (if CUSTOM).static final ValueGenerationStrategyThe value "identity" specifies that the column identified as the key column is managed by the database as an auto-incrementing identity type.static final ValueGenerationStrategyThe value "increment" specifies a strategy that simply finds the largest key already in the database and increments the key value for new instances.static final ValueGenerationStrategyThe value "native" allows the JDO implementation to pick the most suitable strategy based on the underlying database.static final ValueGenerationStrategyThe value "sequence" specifies that a named database sequence is used to generate key values for the table.private static final longstatic final ValueGenerationStrategyThe value "timestamp" specifies a strategy that uses the Java "Timestamp" class, and represents the results as a Timestamp object.static final ValueGenerationStrategyThe value "timestamp-value" specifies a strategy that uses the Java "Timestamp" class, and represents the results as a Long.private final intThe type id.static final ValueGenerationStrategyThe value "uuid" specifies a strategy that uses the Java "UUID" class, and represents the results as a 36-character String.static final ValueGenerationStrategyThe value "uuid-object" specifies a strategy that uses the Java "UUID" class, and represents the results as a UUID object.static final ValueGenerationStrategyThe value "uuid-hex" specifies a strategy that generates a 128-bit UUID unique within a network, and represents the result as a 32-character String.static final ValueGenerationStrategyThe value "uuid-string" specifies a strategy that generates a 128-bit UUID unique within a network, and represents the result as a 16-character String. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAccessor for the custom name (if using strategy type of CUSTOM).static ValueGenerationStrategygetIdentityStrategy(String value) Gets an IdentityStrategy for the given value argument.intgetType()Accessor for the type.inthashCode()toString()Returns a string representation of the object.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
NATIVE
The value "native" allows the JDO implementation to pick the most suitable strategy based on the underlying database. -
SEQUENCE
The value "sequence" specifies that a named database sequence is used to generate key values for the table. -
IDENTITY
The value "identity" specifies that the column identified as the key column is managed by the database as an auto-incrementing identity type. -
INCREMENT
The value "increment" specifies a strategy that simply finds the largest key already in the database and increments the key value for new instances. -
UUIDSTRING
The value "uuid-string" specifies a strategy that generates a 128-bit UUID unique within a network, and represents the result as a 16-character String. -
UUIDHEX
The value "uuid-hex" specifies a strategy that generates a 128-bit UUID unique within a network, and represents the result as a 32-character String. -
AUID
The value "auid" specifies a strategy that is a Java implementation of DCE UUIDs, and represents the results as a 36-character String. -
UUID
The value "uuid" specifies a strategy that uses the Java "UUID" class, and represents the results as a 36-character String. -
UUID_OBJECT
The value "uuid-object" specifies a strategy that uses the Java "UUID" class, and represents the results as a UUID object. -
TIMESTAMP
The value "timestamp" specifies a strategy that uses the Java "Timestamp" class, and represents the results as a Timestamp object. -
TIMESTAMP_VALUE
The value "timestamp-value" specifies a strategy that uses the Java "Timestamp" class, and represents the results as a Long. -
CUSTOM
Extension strategy, that will have the "customName" set to the chosen strategy. -
typeId
private final int typeIdThe type id. -
customName
The Name of the custom type (if CUSTOM).
-
-
Constructor Details
-
ValueGenerationStrategy
private ValueGenerationStrategy(int i) constructor- Parameters:
i- type id
-
-
Method Details
-
getCustomName
Accessor for the custom name (if using strategy type of CUSTOM).- Returns:
- Custom name
-
hashCode
-
equals
-
toString
-
getType
public int getType()Accessor for the type.- Returns:
- Type
-
getIdentityStrategy
Gets an IdentityStrategy for the given value argument.- Parameters:
value- the String representation of IdentityStrategy- Returns:
- the IdentityStrategy corresponding to the value argument. NATIVE IdentityStrategy is returned if the value argument is null or no corresponding strategy was found
-