public class IncrementGenerator extends Object implements IdentifierGenerator, Configurable
<b>increment</b><br> <br> An <tt>IdentifierGenerator</tt> that returns a <tt>long</tt>, constructed by counting from the maximum primary key value at startup. Not safe for use in a cluster!<br> <br> Mapping parameters supported, but not usually needed: tables, column. (The tables parameter specified a comma-separated list of table names.)
ENTITY_NAME, GENERATOR_NAME, JPA_ENTITY_NAME| Constructor and Description |
|---|
IncrementGenerator() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(Type type,
Properties params,
ServiceRegistry serviceRegistry)
Configure this instance, given the value of parameters
specified by the user as <tt><param></tt> elements.
|
Serializable |
generate(SharedSessionContractImplementor session,
Object object)
Generate a new identifier.
|
public Serializable generate(SharedSessionContractImplementor session, Object object) throws HibernateException
IdentifierGeneratorGenerate a new identifier.
generate in interface IdentifierGeneratorsession - The session from which the request originatesobject - the entity or collection (idbag) for which the id is being generatedHibernateException - Indicates trouble generating the identifierpublic void configure(Type type, Properties params, ServiceRegistry serviceRegistry) throws MappingException
ConfigurableConfigure this instance, given the value of parameters specified by the user as <tt><param></tt> elements. This method is called just once, following instantiation.
configure in interface Configurabletype - The id property type descriptorparams - param values, keyed by parameter nameserviceRegistry - Access to service that may be needed.MappingExceptionCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.