Interface ValueGenerator<T>
-
- Type Parameters:
T- Type of the generated value (Long, String etc)
- All Known Implementing Classes:
AbstractConnectedGenerator,AbstractGenerator,AbstractUUIDGenerator,AUIDGenerator,TimestampGenerator,TimestampValueGenerator,UUIDGenerator,UUIDHexGenerator,UUIDObjectGenerator,UUIDStringGenerator
public interface ValueGenerator<T>Generator interface for values.
-
-
Field Summary
Fields Modifier and Type Field Description static StringPROPERTY_CATALOG_NAMECatalog that the value is for.static StringPROPERTY_CLASS_NAMEClass that the value is for.static StringPROPERTY_COLUMN_NAMEColumn that the value is for (i.e which column will have the value applied to it, so we can check for MAX(col)).static StringPROPERTY_FIELD_NAMEField that the value is for.static StringPROPERTY_KEY_CACHE_SIZEstatic StringPROPERTY_KEY_DATABASE_CACHE_SIZEstatic StringPROPERTY_KEY_INITIAL_VALUEstatic StringPROPERTY_KEY_MAX_VALUEstatic StringPROPERTY_KEY_MIN_VALUEstatic StringPROPERTY_ROOT_CLASS_NAMEClass that the value is for.static StringPROPERTY_SCHEMA_NAMESchema that the value is for.static StringPROPERTY_SEQUENCE_NAMEName of any sequence to be used (when using JPA/JDO "sequence" strategy).static StringPROPERTY_SEQUENCETABLE_CATALOGstatic StringPROPERTY_SEQUENCETABLE_NAME_COLUMNstatic StringPROPERTY_SEQUENCETABLE_NEXTVAL_COLUMNstatic StringPROPERTY_SEQUENCETABLE_SCHEMAstatic StringPROPERTY_SEQUENCETABLE_TABLEName of a table to use when using values stored in a table - JPA "table"/JDO "increment" strategy.static StringPROPERTY_TABLE_NAMETable that the value is for (see also column-name).
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidallocate(int additional)Provides a hint to the implementation that the application will needadditionalsequence value objects in short order.Tcurrent()Returns the current sequence value object if it is available.longcurrentValue()Returns the current sequence value as a long.Tnext()Returns the next sequence value as an Object.longnextValue()Returns the next sequence value as a long.
-
-
-
Field Detail
-
PROPERTY_SEQUENCE_NAME
static final String PROPERTY_SEQUENCE_NAME
Name of any sequence to be used (when using JPA/JDO "sequence" strategy).- See Also:
- Constant Field Values
-
PROPERTY_SEQUENCETABLE_TABLE
static final String PROPERTY_SEQUENCETABLE_TABLE
Name of a table to use when using values stored in a table - JPA "table"/JDO "increment" strategy.- See Also:
- Constant Field Values
-
PROPERTY_SEQUENCETABLE_CATALOG
static final String PROPERTY_SEQUENCETABLE_CATALOG
- See Also:
- Constant Field Values
-
PROPERTY_SEQUENCETABLE_SCHEMA
static final String PROPERTY_SEQUENCETABLE_SCHEMA
- See Also:
- Constant Field Values
-
PROPERTY_SEQUENCETABLE_NAME_COLUMN
static final String PROPERTY_SEQUENCETABLE_NAME_COLUMN
- See Also:
- Constant Field Values
-
PROPERTY_SEQUENCETABLE_NEXTVAL_COLUMN
static final String PROPERTY_SEQUENCETABLE_NEXTVAL_COLUMN
- See Also:
- Constant Field Values
-
PROPERTY_KEY_INITIAL_VALUE
static final String PROPERTY_KEY_INITIAL_VALUE
- See Also:
- Constant Field Values
-
PROPERTY_KEY_CACHE_SIZE
static final String PROPERTY_KEY_CACHE_SIZE
- See Also:
- Constant Field Values
-
PROPERTY_KEY_MIN_VALUE
static final String PROPERTY_KEY_MIN_VALUE
- See Also:
- Constant Field Values
-
PROPERTY_KEY_MAX_VALUE
static final String PROPERTY_KEY_MAX_VALUE
- See Also:
- Constant Field Values
-
PROPERTY_KEY_DATABASE_CACHE_SIZE
static final String PROPERTY_KEY_DATABASE_CACHE_SIZE
- See Also:
- Constant Field Values
-
PROPERTY_CATALOG_NAME
static final String PROPERTY_CATALOG_NAME
Catalog that the value is for.- See Also:
- Constant Field Values
-
PROPERTY_SCHEMA_NAME
static final String PROPERTY_SCHEMA_NAME
Schema that the value is for.- See Also:
- Constant Field Values
-
PROPERTY_CLASS_NAME
static final String PROPERTY_CLASS_NAME
Class that the value is for.- See Also:
- Constant Field Values
-
PROPERTY_ROOT_CLASS_NAME
static final String PROPERTY_ROOT_CLASS_NAME
Class that the value is for.- See Also:
- Constant Field Values
-
PROPERTY_FIELD_NAME
static final String PROPERTY_FIELD_NAME
Field that the value is for.- See Also:
- Constant Field Values
-
PROPERTY_TABLE_NAME
static final String PROPERTY_TABLE_NAME
Table that the value is for (see also column-name).- See Also:
- Constant Field Values
-
PROPERTY_COLUMN_NAME
static final String PROPERTY_COLUMN_NAME
Column that the value is for (i.e which column will have the value applied to it, so we can check for MAX(col)).- See Also:
- Constant Field Values
-
-
Method Detail
-
next
T next()
Returns the next sequence value as an Object. If the next sequence value is not available, throw NucleusDataStoreException.- Returns:
- the next value
-
allocate
void allocate(int additional)
Provides a hint to the implementation that the application will needadditionalsequence value objects in short order. There is no externally visible behavior of this method. It is used to potentially improve the efficiency of the algorithm of obtaining additional sequence value objects.- Parameters:
additional- the number of additional values to allocate
-
current
T current()
Returns the current sequence value object if it is available. It is intended to return a sequence value object previously used. If the current sequence value is not available, throw NucleusDataStoreException.- Returns:
- the current value
-
nextValue
long nextValue()
Returns the next sequence value as a long. If the next sequence value is not available or is not numeric, throw NucleusDataStoreException.- Returns:
- the next value
-
currentValue
long currentValue()
Returns the current sequence value as a long. If the current sequence value is not available or is not numeric, throw NucleusDataStoreException.- Returns:
- the current value
-
-