Class TimestampGenerator

java.lang.Object
org.datanucleus.store.valuegenerator.AbstractGenerator<Timestamp>
org.datanucleus.store.valuegenerator.TimestampGenerator
All Implemented Interfaces:
ValueGenerator<Timestamp>

public class TimestampGenerator extends AbstractGenerator<Timestamp>
Value generator for timestamps.
  • Constructor Details

    • TimestampGenerator

      public TimestampGenerator(StoreManager storeMgr, String name)
      Constructor.
      Parameters:
      storeMgr - StoreManager
      name - Symbolic name of the generator
  • Method Details

    • getStorageClass

      public static Class getStorageClass()
      Accessor for the storage class for values generated with this generator.
      Returns:
      Storage class (in this case Timestamp.class)
    • reserveBlock

      protected ValueGenerationBlock<Timestamp> reserveBlock(long size)
      Method to reserve a block of values. Only ever reserves a single timestamp, to the time at which it is created.
      Specified by:
      reserveBlock in class AbstractGenerator<Timestamp>
      Parameters:
      size - Number of elements to reserve.
      Returns:
      The block.