Top Description Fields Constructors Methods
org.hibernate.id

public Class IncrementGenerator

extends Object
implements IdentifierGenerator, Configurable
Class Inheritance
All Implemented Interfaces
org.hibernate.id.Configurable, org.hibernate.id.IdentifierGenerator
Imports
java.io.Serializable, java.sql.PreparedStatement, .ResultSet, .SQLException, java.util.Properties, org.slf4j.Logger, .LoggerFactory, org.hibernate.HibernateException, .MappingException, org.hibernate.cfg.ObjectNameNormalizer, org.hibernate.dialect.Dialect, org.hibernate.engine.SessionImplementor, org.hibernate.exception.JDBCExceptionHelper, org.hibernate.mapping.Table, org.hibernate.type.Type, org.hibernate.util.StringHelper

increment

An IdentifierGenerator that returns a long, constructed by counting from the maximum primary key value at startup. Not safe for use in a cluster!

Mapping parameters supported, but not usually needed: tables, column. (The tables parameter specified a comma-separated list of table names.)
Authors
Gavin King, Steve Ebersole

Field Summary

Modifier and TypeField and Description
private static final Logger
private IntegralDataTypeHolder
private Class<T>
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
configure(Type type, Properties
param values, keyed by parameter name
params
,
Dialect dialect)

Implements org.hibernate.id.Configurable.configure.

Configure this instance, given the value of parameters specified by the user as <param> elements.
public synchronized Serializable
generate(SessionImplementor session, Object
the entity or toplevel collection for which the id is being generated
object
)

Implements org.hibernate.id.IdentifierGenerator.generate.

Generate a new identifier.
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

logback to summary
private static final Logger log
previousValueHolderback to summary
private IntegralDataTypeHolder previousValueHolder
returnClassback to summary
private Class<T> returnClass
sqlback to summary
private String sql

Constructor Detail

IncrementGeneratorback to summary
public IncrementGenerator()

Method Detail

configureback to summary
public void configure(Type type, Properties params, Dialect dialect) throws MappingException

Implements org.hibernate.id.Configurable.configure.

Doc from org.hibernate.id.Configurable.configure.

Configure this instance, given the value of parameters specified by the user as <param> elements. This method is called just once, following instantiation.

Parameters
params:Properties

param values, keyed by parameter name

generateback to summary
public synchronized Serializable generate(SessionImplementor session, Object object) throws HibernateException

Implements org.hibernate.id.IdentifierGenerator.generate.

Doc from org.hibernate.id.IdentifierGenerator.generate.

Generate a new identifier.

Parameters
object:Object

the entity or toplevel collection for which the id is being generated

Returns:Serializable

a new identifier

initializePreviousValueHolderback to summary
private void initializePreviousValueHolder(SessionImplementor session)