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

public Class OptimizerFactory

extends Object
Class Inheritance
Imports
java.io.Serializable, java.lang.reflect.Constructor, org.slf4j.Logger, .LoggerFactory, org.hibernate.HibernateException, org.hibernate.id.IntegralDataTypeHolder, org.hibernate.util.ReflectHelper, .StringHelper

Factory for Optimizer instances.
Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
OptimizerFactory.HiLoOptimizer

Optimizer which applies a 'hilo' algorithm in memory to achieve optimization.

public static interface
OptimizerFactory.InitialValueAwareOptimizer

Marker interface for optimizer which wish to know the user-specified initial value.

public static class
public static class
OptimizerFactory.NoopOptimizer

An optimizer that performs no optimization.

public abstract static class
OptimizerFactory.OptimizerSupport

Common support for optimizer implementations.

public static class
public static class
OptimizerFactory.PooledOptimizer

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

public static enum

Field Summary

Modifier and TypeField and Description
private static Class<T>[]
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static Optimizer
buildFallbackOptimizer(Class<T> returnClass, int incrementSize)

public static Optimizer

Returns:

The built optimizer
buildOptimizer
(String
The optimizer type, either a short-hand name or the Optimizer class name.
type
,
Class<T>
The generated value java type
returnClass
,
int
The increment size.
incrementSize
)

Builds an optimizer
public static Optimizer

Returns:

The built optimizer
buildOptimizer
(String
The optimizer type, either a short-hand name or the Optimizer class name.
type
,
Class<T>
The generated value java type
returnClass
,
int
The increment size.
incrementSize
,
long
The user supplied initial-value (-1 indicates the user did not specify).
explicitInitialValue
)

Builds an optimizer

public static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CTOR_SIGback to summary
private static Class<T>[] CTOR_SIG
logback to summary
private static final Logger log

Constructor Detail

OptimizerFactoryback to summary
public OptimizerFactory()

Method Detail

buildFallbackOptimizerback to summary
private static Optimizer buildFallbackOptimizer(Class<T> returnClass, int incrementSize)
buildOptimizerback to summary
public static Optimizer buildOptimizer(String type, Class<T> returnClass, int incrementSize)

Builds an optimizer

Parameters
type:String

The optimizer type, either a short-hand name or the Optimizer class name.

returnClass:Class<T>

The generated value java type

incrementSize:int

The increment size.

Returns:Optimizer

The built optimizer

Annotations
@SuppressWarnings:UnnecessaryBoxing, unchecked
buildOptimizerback to summary
public static Optimizer buildOptimizer(String type, Class<T> returnClass, int incrementSize, long explicitInitialValue)

Builds an optimizer

Parameters
type:String

The optimizer type, either a short-hand name or the Optimizer class name.

returnClass:Class<T>

The generated value java type

incrementSize:int

The increment size.

explicitInitialValue:long

The user supplied initial-value (-1 indicates the user did not specify).

Returns:Optimizer

The built optimizer

Annotations
@SuppressWarnings:UnnecessaryBoxing, deprecation
isPooledOptimizerback to summary
public static boolean isPooledOptimizer(String type)
org.hibernate.id.enhanced back to summary

public Class OptimizerFactory.HiLoOptimizer

extends OptimizerSupport
Class Inheritance

Optimizer which applies a 'hilo' algorithm in memory to achieve optimization.

A 'hilo' algorithm is simply a means for a single value stored in the database to represent a "bucket" of possible, contiguous values. The database value identifies which particular bucket we are on.

This database value must be paired with another value that defines the size of the bucket; the number of possible values available. The incrementSize serves this purpose. The naming here is meant more for consistency in that this value serves the same purpose as the increment supplied to the PooledOptimizer.

The general algorithms used to determine the bucket are:

  1. upperLimit = (databaseValue * incrementSize) + 1
  2. lowerLimit = upperLimit - 1
As an example, consider a case with incrementSize of 10. Initially the database holds 1:
  1. upperLimit = (1 * 20) + 1 = 21
  2. lowerLimit = 21 - 20 = 1
From there we increment the value from lowerLimit until we reach the upperLimit, at which point we would define a new bucket. The database now contains 2, though incrementSize remains unchanged:
  1. upperLimit = (2 * 20) + 1 = 41
  2. lowerLimit = 41 - 20 = 21
And so on...

Note, 'value' always (after init) holds the next value to return

Field Summary

Modifier and TypeField and Description
private IntegralDataTypeHolder
private IntegralDataTypeHolder
private IntegralDataTypeHolder
Inherited from org.hibernate.id.enhanced.OptimizerFactory.OptimizerSupport:
incrementSizereturnClass

Constructor Summary

AccessConstructor and Description
public
HiLoOptimizer(Class<T> returnClass, int incrementSize)

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

Returns:

Value for property 'upperLimit'.
getHiValue
()

Getter for property 'upperLimit'.

public IntegralDataTypeHolder
getLastSourceValue()

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

A common means to access the last value obtained from the underlying source.
public IntegralDataTypeHolder

Returns:

Value for property 'lastValue'.
getLastValue
()

Getter for property 'lastValue'.

Inherited from org.hibernate.id.enhanced.OptimizerFactory.OptimizerSupport:
getIncrementSizegetReturnClass

Field Detail

lastSourceValueback to summary
private IntegralDataTypeHolder lastSourceValue
upperLimitback to summary
private IntegralDataTypeHolder upperLimit
valueback to summary
private IntegralDataTypeHolder value

Constructor Detail

HiLoOptimizerback to summary
public HiLoOptimizer(Class<T> returnClass, int incrementSize)

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.

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.

Parameters
callback:AccessCallback

Callback to access the underlying value source.

Returns:Serializable

The generated identifier value.

getHiValueback to summary
public IntegralDataTypeHolder getHiValue()

Getter for property 'upperLimit'.

Exposure intended for testing purposes.

Returns:IntegralDataTypeHolder

Value for property 'upperLimit'.

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.

getLastValueback to summary
public IntegralDataTypeHolder getLastValue()

Getter for property 'lastValue'.

Exposure intended for testing purposes.

Returns:IntegralDataTypeHolder

Value for property 'lastValue'.

org.hibernate.id.enhanced back to summary

public Interface OptimizerFactory.InitialValueAwareOptimizer

Known Direct Implementers
org.hibernate.id.enhanced.OptimizerFactory.PooledOptimizer

Marker interface for optimizer which wish to know the user-specified initial value.

Used instead of constructor injection since that is already a public understanding and because not all optimizers care.

Method Summary

Modifier and TypeMethod and Description
public void
injectInitialValue(long
The initial value specified by the user, or -1 to indicate that the user did not specify.
initialValue
)

Reports the user specified initial value to the optimizer.

Method Detail

injectInitialValueback to summary
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:long

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

org.hibernate.id.enhanced back to summary

public Class OptimizerFactory.LegacyHiLoAlgorithmOptimizer

extends OptimizerSupport
Class Inheritance

Field Summary

Modifier and TypeField and Description
private IntegralDataTypeHolder
private IntegralDataTypeHolder
private long
private long
private IntegralDataTypeHolder
Inherited from org.hibernate.id.enhanced.OptimizerFactory.OptimizerSupport:
incrementSizereturnClass

Constructor Summary

AccessConstructor and Description
public
LegacyHiLoAlgorithmOptimizer(Class<T> returnClass, int incrementSize)

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.
public IntegralDataTypeHolder

Returns:

Value for property 'lastValue'.
getLastValue
()

Getter for property 'lastValue'.

Inherited from org.hibernate.id.enhanced.OptimizerFactory.OptimizerSupport:
getIncrementSizegetReturnClass

Field Detail

hiback to summary
private IntegralDataTypeHolder hi
lastSourceValueback to summary
private IntegralDataTypeHolder lastSourceValue
loback to summary
private long lo
maxLoback to summary
private long maxLo
valueback to summary
private IntegralDataTypeHolder value

Constructor Detail

LegacyHiLoAlgorithmOptimizerback to summary
public LegacyHiLoAlgorithmOptimizer(Class<T> returnClass, int incrementSize)

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.

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.

Parameters
callback:AccessCallback

Callback to access the underlying value source.

Returns:Serializable

The generated identifier value.

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.

getLastValueback to summary
public IntegralDataTypeHolder getLastValue()

Getter for property 'lastValue'.

Exposure intended for testing purposes.

Returns:IntegralDataTypeHolder

Value for property 'lastValue'.

Annotations
@SuppressWarnings:UnusedDeclaration
org.hibernate.id.enhanced back to summary

public Class OptimizerFactory.NoopOptimizer

extends OptimizerSupport
Class Inheritance

An optimizer that performs no optimization. The database is hit for every request.

Field Summary

Modifier and TypeField and Description
private IntegralDataTypeHolder
Inherited from org.hibernate.id.enhanced.OptimizerFactory.OptimizerSupport:
incrementSizereturnClass

Constructor Summary

AccessConstructor and Description
public
NoopOptimizer(Class<T> returnClass, int incrementSize)

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 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.
Inherited from org.hibernate.id.enhanced.OptimizerFactory.OptimizerSupport:
getIncrementSizegetReturnClass

Field Detail

lastSourceValueback to summary
private IntegralDataTypeHolder lastSourceValue

Constructor Detail

NoopOptimizerback to summary
public NoopOptimizer(Class<T> returnClass, int incrementSize)

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.

generateback to summary
public 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.

Parameters
callback:AccessCallback

Callback to access the underlying value source.

Returns:Serializable

The generated identifier value.

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.

org.hibernate.id.enhanced back to summary

public abstract Class OptimizerFactory.OptimizerSupport

extends Object
implements Optimizer
Class Inheritance
All Implemented Interfaces
org.hibernate.id.enhanced.Optimizer
Known Direct Subclasses
org.hibernate.id.enhanced.OptimizerFactory.NoopOptimizer, org.hibernate.id.enhanced.OptimizerFactory.HiLoOptimizer, org.hibernate.id.enhanced.OptimizerFactory.LegacyHiLoAlgorithmOptimizer, org.hibernate.id.enhanced.OptimizerFactory.PooledOptimizer, org.hibernate.id.enhanced.OptimizerFactory.PooledLoOptimizer

Common support for optimizer implementations.

Field Summary

Modifier and TypeField and Description
protected final int
protected final Class<T>

Constructor Summary

AccessConstructor and Description
protected
OptimizerSupport(Class<T>
The expected id class.
returnClass
,
int
The increment size
incrementSize
)

Construct an optimizer

Method Summary

Modifier and TypeMethod and Description
public final int
getIncrementSize()

Implements org.hibernate.id.enhanced.Optimizer.getIncrementSize.

Retrieves the defined increment size.
public final Class<T>

Returns:

Value for property 'returnClass'.
getReturnClass
()

Getter for property 'returnClass'.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

incrementSizeback to summary
protected final int incrementSize
returnClassback to summary
protected final Class<T> returnClass

Constructor Detail

OptimizerSupportback to summary
protected OptimizerSupport(Class<T> returnClass, int incrementSize)

Construct an optimizer

Parameters
returnClass:Class<T>

The expected id class.

incrementSize:int

The increment size

Method Detail

getIncrementSizeback to summary
public final int getIncrementSize()

Implements org.hibernate.id.enhanced.Optimizer.getIncrementSize.

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

Retrieves the defined increment size.

Returns:int

The increment size.

getReturnClassback to summary
public final Class<T> getReturnClass()

Getter for property 'returnClass'. This is the Java class which is used to represent the id (e.g. java.lang.Long).

Returns:Class<T>

Value for property 'returnClass'.

Annotations
@SuppressWarnings:UnusedDeclaration
org.hibernate.id.enhanced back to summary

public Class OptimizerFactory.PooledLoOptimizer

extends OptimizerSupport
Class Inheritance

Field Summary

Modifier and TypeField and Description
private IntegralDataTypeHolder
private IntegralDataTypeHolder
Inherited from org.hibernate.id.enhanced.OptimizerFactory.OptimizerSupport:
incrementSizereturnClass

Constructor Summary

AccessConstructor and Description
public
PooledLoOptimizer(Class<T> returnClass, int incrementSize)

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 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.
Inherited from org.hibernate.id.enhanced.OptimizerFactory.OptimizerSupport:
getIncrementSizegetReturnClass

Field Detail

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

Constructor Detail

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

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.

generateback to summary
public 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.

Parameters
callback:AccessCallback

Callback to access the underlying value source.

Returns:Serializable

The generated identifier value.

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.

org.hibernate.id.enhanced back to summary

public Class OptimizerFactory.PooledOptimizer

extends OptimizerSupport
implements InitialValueAwareOptimizer
Class Inheritance
All Implemented Interfaces
org.hibernate.id.enhanced.OptimizerFactory.InitialValueAwareOptimizer

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 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 PooledLoOptimizer strategy

Field Summary

Modifier and TypeField and Description
private IntegralDataTypeHolder
private long
private IntegralDataTypeHolder
Inherited from org.hibernate.id.enhanced.OptimizerFactory.OptimizerSupport:
incrementSizereturnClass

Constructor Summary

AccessConstructor and Description
public
PooledOptimizer(Class<T> returnClass, int incrementSize)

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.
public IntegralDataTypeHolder

Returns:

Value for property 'lastValue'.
getLastValue
()

Getter for property 'lastValue'.

public void
injectInitialValue(long
The initial value specified by the user, or -1 to indicate that the user did not specify.
initialValue
)

Implements org.hibernate.id.enhanced.OptimizerFactory.InitialValueAwareOptimizer.injectInitialValue.

Reports the user specified initial value to the optimizer.
Inherited from org.hibernate.id.enhanced.OptimizerFactory.OptimizerSupport:
getIncrementSizegetReturnClass

Field Detail

hiValueback to summary
private IntegralDataTypeHolder hiValue
initialValueback to summary
private long initialValue
valueback to summary
private IntegralDataTypeHolder value

Constructor Detail

PooledOptimizerback to summary
public PooledOptimizer(Class<T> returnClass, int incrementSize)

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.

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.

Parameters
callback:AccessCallback

Callback to access the underlying value source.

Returns:Serializable

The generated identifier value.

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.

getLastValueback to summary
public IntegralDataTypeHolder getLastValue()

Getter for property 'lastValue'.

Exposure intended for testing purposes.

Returns:IntegralDataTypeHolder

Value for property 'lastValue'.

injectInitialValueback to summary
public void injectInitialValue(long initialValue)

Implements org.hibernate.id.enhanced.OptimizerFactory.InitialValueAwareOptimizer.injectInitialValue.

Doc from org.hibernate.id.enhanced.OptimizerFactory.InitialValueAwareOptimizer.injectInitialValue.

Reports the user specified initial value to the optimizer.

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

Parameters
initialValue:long

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

org.hibernate.id.enhanced back to summary

public final Enum OptimizerFactory.StandardOptimizerDescriptor

extends Enum<OptimizerFactory.StandardOptimizerDescriptor>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final String
public static final OptimizerFactory.StandardOptimizerDescriptor
private final boolean
public static final OptimizerFactory.StandardOptimizerDescriptor
public static final OptimizerFactory.StandardOptimizerDescriptor
private final Class<? extends Optimizer>
public static final OptimizerFactory.StandardOptimizerDescriptor
public static final OptimizerFactory.StandardOptimizerDescriptor

Constructor Summary

AccessConstructor and Description
private
StandardOptimizerDescriptor(String externalName, Class<? extends Optimizer> optimizerClass)

private
StandardOptimizerDescriptor(String externalName, Class<? extends Optimizer> optimizerClass, boolean pooled)

Method Summary

Modifier and TypeMethod and Description
public static OptimizerFactory.StandardOptimizerDescriptor
fromExternalName(String externalName)

public String
public Class<? extends Optimizer>
public boolean
public static OptimizerFactory.StandardOptimizerDescriptor
public static OptimizerFactory.StandardOptimizerDescriptor[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

externalNameback to summary
private final String externalName
HILOback to summary
public static final OptimizerFactory.StandardOptimizerDescriptor HILO
isPooledback to summary
private final boolean isPooled
LEGACY_HILOback to summary
public static final OptimizerFactory.StandardOptimizerDescriptor LEGACY_HILO
NONEback to summary
public static final OptimizerFactory.StandardOptimizerDescriptor NONE
optimizerClassback to summary
private final Class<? extends Optimizer> optimizerClass
POOLEDback to summary
public static final OptimizerFactory.StandardOptimizerDescriptor POOLED
POOLED_LOback to summary
public static final OptimizerFactory.StandardOptimizerDescriptor POOLED_LO

Constructor Detail

StandardOptimizerDescriptorback to summary
private StandardOptimizerDescriptor(String externalName, Class<? extends Optimizer> optimizerClass)
StandardOptimizerDescriptorback to summary
private StandardOptimizerDescriptor(String externalName, Class<? extends Optimizer> optimizerClass, boolean pooled)

Method Detail

fromExternalNameback to summary
public static OptimizerFactory.StandardOptimizerDescriptor fromExternalName(String externalName)
getExternalNameback to summary
public String getExternalName()
getOptimizerClassback to summary
public Class<? extends Optimizer> getOptimizerClass()
isPooledback to summary
public boolean isPooled()
valueOfback to summary
public static OptimizerFactory.StandardOptimizerDescriptor valueOf(String name)
valuesback to summary
public static OptimizerFactory.StandardOptimizerDescriptor[] values()