org.datanucleus.store.neodatis.valuegenerator
Class NeoDatisIncrementGenerator

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

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

Value generator for NeoDatis 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
NeoDatisIncrementGenerator(java.lang.String name, java.util.Properties props)
          Constructor.
 
Method Summary
protected  org.datanucleus.store.valuegenerator.ValueGenerationBlock obtainGenerationBlock(int number)
          Get a new PoidBlock with the specified number of ids.
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

NeoDatisIncrementGenerator

public NeoDatisIncrementGenerator(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 PoidBlock with the specified number of ids.

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

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 © 2009. All Rights Reserved.