org.datanucleus.store.db4o.valuegenerator
Class DB4OIncrementGenerator

java.lang.Object
  extended by org.datanucleus.store.valuegenerator.AbstractGenerator
      extended by org.datanucleus.store.valuegenerator.AbstractDatastoreGenerator
          extended by org.datanucleus.store.db4o.valuegenerator.DB4OIncrementGenerator
All Implemented Interfaces:
org.datanucleus.store.valuegenerator.ValueGenerator

public class DB4OIncrementGenerator
extends org.datanucleus.store.valuegenerator.AbstractDatastoreGenerator

Value generator for DB4O that provides increment/sequence like generation. Utilises the persistence of objects of NucleusSequence. Each objects stores the sequence class/field name and the current value of that sequence.


Field Summary
protected static org.datanucleus.util.Localiser LOCALISER_DB4O
          Localiser for messages.
 
Fields inherited from class org.datanucleus.store.valuegenerator.AbstractDatastoreGenerator
connectionProvider, storeMgr
 
Fields inherited from class org.datanucleus.store.valuegenerator.AbstractGenerator
allocationSize, block, initialValue, LOCALISER, name, properties, repositoryExists
 
Constructor Summary
DB4OIncrementGenerator(java.lang.String name, java.util.Properties props)
          Constructor.
 
Method Summary
protected  org.datanucleus.store.valuegenerator.ValueGenerationBlock obtainGenerationBlock(int number)
          Get a new block with the specified number of values.
protected  org.datanucleus.store.valuegenerator.ValueGenerationBlock reserveBlock(long size)
          Method to reserve a block of "size" identities.
 
Methods inherited from class org.datanucleus.store.valuegenerator.AbstractDatastoreGenerator
setConnectionProvider, setStoreManager
 
Methods inherited from class org.datanucleus.store.valuegenerator.AbstractGenerator
allocate, createRepository, current, currentValue, getName, getStorageClass, next, nextValue, obtainGenerationBlock, repositoryExists, requiresRepository, reserveBlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALISER_DB4O

protected static final org.datanucleus.util.Localiser LOCALISER_DB4O
Localiser for messages.

Constructor Detail

DB4OIncrementGenerator

public DB4OIncrementGenerator(java.lang.String name,
                              java.util.Properties props)
Constructor.

Parameters:
name - Symbolic name for this generator
props - Properties defining the behaviour of this generator
Method Detail

obtainGenerationBlock

protected org.datanucleus.store.valuegenerator.ValueGenerationBlock obtainGenerationBlock(int number)
Get a new block with the specified number of values.

Overrides:
obtainGenerationBlock in class org.datanucleus.store.valuegenerator.AbstractGenerator
Parameters:
number - The number of additional values required
Returns:
the block

reserveBlock

protected org.datanucleus.store.valuegenerator.ValueGenerationBlock reserveBlock(long size)
Method to reserve a block of "size" identities.

Specified by:
reserveBlock in class org.datanucleus.store.valuegenerator.AbstractGenerator
Parameters:
size - Block size
Returns:
The reserved block


Copyright © 2012. All Rights Reserved.