Class UUIDStringGenerator
java.lang.Object
org.datanucleus.store.valuegenerator.AbstractGenerator<String>
org.datanucleus.store.valuegenerator.AbstractUUIDGenerator
org.datanucleus.store.valuegenerator.UUIDStringGenerator
- All Implemented Interfaces:
ValueGenerator<String>
Value generator for a UUID String format.
Results in Strings of length 16 characters, containing the IP address of the local machine as per the JDO spec section 18.6.1.
-
Field Summary
Fields inherited from class AbstractUUIDGenerator
counter, IP_ADDRESS, JVM_UNIQUEFields inherited from class AbstractGenerator
allocationSize, block, initialValue, name, storeMgrFields inherited from interface ValueGenerator
PROPERTY_CATALOG_NAME, PROPERTY_CLASS_NAME, PROPERTY_COLUMN_NAME, PROPERTY_FIELD_NAME, PROPERTY_KEY_CACHE_SIZE, PROPERTY_KEY_DATABASE_CACHE_SIZE, PROPERTY_KEY_INITIAL_VALUE, PROPERTY_KEY_MAX_VALUE, PROPERTY_KEY_MIN_VALUE, PROPERTY_ROOT_CLASS_NAME, PROPERTY_SCHEMA_NAME, PROPERTY_SEQUENCE_NAME, PROPERTY_SEQUENCETABLE_CATALOG, PROPERTY_SEQUENCETABLE_NAME_COLUMN, PROPERTY_SEQUENCETABLE_NEXTVAL_COLUMN, PROPERTY_SEQUENCETABLE_SCHEMA, PROPERTY_SEQUENCETABLE_TABLE, PROPERTY_TABLE_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static byte[]getBytesFromInt(int val) Utility to convert an int into a byte arrayprivate static byte[]getBytesFromShort(short val) Utility to convert a short into a a byte arrayprotected StringCreate an identifier with the form "IIIIJJJJHHLLLLCC".static ClassAccessor for the storage class for values generated with this generator.Methods inherited from class AbstractUUIDGenerator
getCount, reserveBlockMethods inherited from class AbstractGenerator
allocate, current, currentValue, getName, next, nextValue, obtainGenerationBlock, obtainGenerationBlock, reserveBlock
-
Constructor Details
-
UUIDStringGenerator
Constructor.- Parameters:
storeMgr- StoreManagername- Symbolic name for this generator
-
-
Method Details
-
getStorageClass
Accessor for the storage class for values generated with this generator.- Returns:
- Storage class (in this case String.class)
-
getIdentifier
Create an identifier with the form "IIIIJJJJHHLLLLCC". Where IIII is the IP address, JJJJ is something unique across JVMs, HH is the High Time, LLLL is the low time, and CC is a count.- Specified by:
getIdentifierin classAbstractUUIDGenerator- Returns:
- The identifier
-
getBytesFromInt
private static byte[] getBytesFromInt(int val) Utility to convert an int into a byte array- Parameters:
val- The int- Returns:
- The bytes
-
getBytesFromShort
private static byte[] getBytesFromShort(short val) Utility to convert a short into a a byte array- Parameters:
val- The short- Returns:
- The bytes
-