Top Description Inners Fields Constructors Methods
org.hibernate.id.enhanced

public Class PooledLoOptimizer

extends AbstractOptimizer
Class Inheritance
Imports
java.io.Serializable, java.util.Map, java.util.concurrent.ConcurrentHashMap, org.hibernate.HibernateException, org.hibernate.id.IntegralDataTypeHolder, org.hibernate.internal.CoreMessageLogger, org.jboss.logging.Logger

Variation of PooledOptimizer which interprets the incoming database value as the lo value, rather than the hi value.
Author
Steve Ebersole
See Also
PooledOptimizer

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final CoreMessageLogger
private PooledLoOptimizer.GenerationState
private Map<String, PooledLoOptimizer.GenerationState>
Inherited from org.hibernate.id.enhanced.AbstractOptimizer:
incrementSizereturnClass

Constructor Summary

AccessConstructor and Description
public
PooledLoOptimizer(Class<T>
The Java type of the values to be generated
returnClass
,
int
The increment size.
incrementSize
)

Constructs a PooledLoOptimizer.

Method Summary

Modifier and TypeMethod and Description
public boolean
applyIncrementSizeToSourceValues()

Implements org.hibernate.id.enhanced.Optimizer.applyIncrementSizeToSourceValues.

Are increments to be applied to the values stored in the underlying value source?
public synchronized Serializable
generate(AccessCallback
Callback to access the underlying value source.
callback
)

Implements org.hibernate.id.enhanced.Optimizer.generate.

Generate an identifier value accounting for this specific optimization.
public IntegralDataTypeHolder
getLastSourceValue()

Implements org.hibernate.id.enhanced.Optimizer.getLastSourceValue.

A common means to access the last value obtained from the underlying source.
private PooledLoOptimizer.GenerationState
locateGenerationState(String tenantIdentifier)

private PooledLoOptimizer.GenerationState
Inherited from org.hibernate.id.enhanced.AbstractOptimizer:
getIncrementSizegetReturnClass

Field Detail

LOGback to summary
private static final CoreMessageLogger LOG
noTenantStateback to summary
private PooledLoOptimizer.GenerationState noTenantState
tenantSpecificStateback to summary
private Map<String, PooledLoOptimizer.GenerationState> tenantSpecificState

Constructor Detail

PooledLoOptimizerback to summary
public PooledLoOptimizer(Class<T> returnClass, int incrementSize)

Constructs a PooledLoOptimizer.

Parameters
returnClass:Class<T>

The Java type of the values to be generated

incrementSize:int

The increment size.

Method Detail

applyIncrementSizeToSourceValuesback to summary
public boolean applyIncrementSizeToSourceValues()

Implements org.hibernate.id.enhanced.Optimizer.applyIncrementSizeToSourceValues.

Doc from org.hibernate.id.enhanced.Optimizer.applyIncrementSizeToSourceValues.

Are increments to be applied to the values stored in the underlying value source?

Returns:boolean

True if the values in the source are to be incremented according to the defined increment size; false otherwise, in which case the increment is totally an in memory construct.

Annotations
@Override
generateback to summary
public synchronized Serializable generate(AccessCallback callback)

Implements org.hibernate.id.enhanced.Optimizer.generate.

Doc from org.hibernate.id.enhanced.Optimizer.generate.

Generate an identifier value accounting for this specific optimization. All known implementors are synchronized. Consider carefully if a new implementation could drop this requirement.

Parameters
callback:AccessCallback

Callback to access the underlying value source.

Returns:Serializable

The generated identifier value.

Annotations
@Override
getLastSourceValueback to summary
public IntegralDataTypeHolder getLastSourceValue()

Implements org.hibernate.id.enhanced.Optimizer.getLastSourceValue.

Doc from org.hibernate.id.enhanced.Optimizer.getLastSourceValue.

A common means to access the last value obtained from the underlying source. This is intended for testing purposes, since accessing the underlying database source directly is much more difficult.

Returns:IntegralDataTypeHolder

The last value we obtained from the underlying source; null indicates we have not yet consulted with the source.

Annotations
@Override
locateGenerationStateback to summary
private PooledLoOptimizer.GenerationState locateGenerationState(String tenantIdentifier)
noTenantGenerationStateback to summary
private PooledLoOptimizer.GenerationState noTenantGenerationState()
org.hibernate.id.enhanced back to summary

private Class PooledLoOptimizer.GenerationState

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private IntegralDataTypeHolder
private IntegralDataTypeHolder
private IntegralDataTypeHolder

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

lastSourceValueback to summary
private IntegralDataTypeHolder lastSourceValue
upperLimitValueback to summary
private IntegralDataTypeHolder upperLimitValue
valueback to summary
private IntegralDataTypeHolder value

Constructor Detail

GenerationStateback to summary
private GenerationState()