public class IncrementGenerator extends Object implements IdentifierGenerator
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 <param> elements.
|
Serializable |
generate(SharedSessionContractImplementor session,
Object object)
Generate a new identifier.
|
String[] |
getAllSqlForTests()
Deprecated.
Exposed for tests only.
|
void |
initialize(SqlStringGenerationContext context)
Initializes this instance, in particular pre-generates SQL as necessary.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
registerExportables, supportsJdbcBatchInserts
@Deprecated public String[] getAllSqlForTests()
public Serializable generate(SharedSessionContractImplementor session, Object object) throws HibernateException
IdentifierGenerator
generate
in interface IdentifierGenerator
session
- 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
IdentifierGenerator
This method is called just once, following instantiation, and before IdentifierGenerator.registerExportables(Database)
.
configure
in interface Configurable
configure
in interface IdentifierGenerator
type
- The id property type descriptorparams
- param values, keyed by parameter nameserviceRegistry
- Access to service that may be needed.MappingException
- If configuration fails.public void initialize(SqlStringGenerationContext context)
IdentifierGenerator
This method is called after IdentifierGenerator.registerExportables(Database)
, before first use.
initialize
in interface IdentifierGenerator
context
- A context to help generate SQL stringsCopyright © 2001-2021 Red Hat, Inc. All Rights Reserved.