public static class

OptimizerFactory.PooledOptimizer

extends OptimizerFactory.OptimizerSupport
implements OptimizerFactory.InitialValueAwareOptimizer
java.lang.Object
   ↳ org.hibernate.id.enhanced.OptimizerFactory.OptimizerSupport
     ↳ org.hibernate.id.enhanced.OptimizerFactory.PooledOptimizer

Class Overview

Optimizer which uses a pool of values, storing the next low value of the range in the database.

Note that this optimizer works essentially the same as the OptimizerFactory.HiLoOptimizer except that here the bucket ranges are actually encoded into the database structures.

Note if you prefer that the database value be interpreted as the bottom end of our current range, then use the OptimizerFactory.PooledLoOptimizer strategy

Summary

[Expand]
Inherited Fields
From class org.hibernate.id.enhanced.OptimizerFactory.OptimizerSupport
Public Constructors
OptimizerFactory.PooledOptimizer(Class returnClass, int incrementSize)
Public Methods
boolean applyIncrementSizeToSourceValues()
synchronized Serializable generate(AccessCallback callback)
IntegralDataTypeHolder getLastSourceValue()
IntegralDataTypeHolder getLastValue()
Getter for property 'lastValue'.
void injectInitialValue(long initialValue)
Reports the user specified initial value to the optimizer.
[Expand]
Inherited Methods
From class org.hibernate.id.enhanced.OptimizerFactory.OptimizerSupport
From class java.lang.Object
From interface org.hibernate.id.enhanced.Optimizer
From interface org.hibernate.id.enhanced.OptimizerFactory.InitialValueAwareOptimizer

Public Constructors

public OptimizerFactory.PooledOptimizer (Class returnClass, int incrementSize)

Public Methods

public boolean applyIncrementSizeToSourceValues ()

public synchronized Serializable generate (AccessCallback callback)

public IntegralDataTypeHolder getLastSourceValue ()

public IntegralDataTypeHolder getLastValue ()

Getter for property 'lastValue'.

Exposure intended for testing purposes.

Returns
  • Value for property 'lastValue'.

public void injectInitialValue (long initialValue)

Reports the user specified initial value to the optimizer.

-1 is used to indicate that the user did not specify.

Parameters
initialValue The initial value specified by the user, or -1 to indicate that the user did not specify.