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

public final Class NoopOptimizer

extends AbstractOptimizer
Class Inheritance
Imports
java.io.Serializable, org.hibernate.id.IntegralDataTypeHolder

An optimizer that performs no optimization. A round-trip to the database is required for each new id.

This implementation is not the most efficient one.

Field Summary

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

Constructor Summary

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

Constructs a NoopOptimizer

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.AbstractOptimizer:
getIncrementSizegetReturnClass

Field Detail

lastSourceValueback to summary
private IntegralDataTypeHolder lastSourceValue

Constructor Detail

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

Constructs a NoopOptimizer

Parameters
returnClass:Class<?>

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