public interface IdentifierGenerator extends Configurable, ExportableProducer
PersistentIdentifierGenerator| Modifier and Type | Field and Description |
|---|---|
static String |
ENTITY_NAME
The configuration parameter holding the entity name
|
static String |
GENERATOR_NAME
Used as a key to pass the name used as
GeneratedValue.generator() to the
IdentifierGenerator as it is configured. |
static String |
JPA_ENTITY_NAME
The configuration parameter holding the JPA entity name
|
| Modifier and Type | Method and Description |
|---|---|
default 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.
|
default void |
initialize(SqlStringGenerationContext context)
Initializes this instance, in particular pre-generates SQL as necessary.
|
default void |
registerExportables(Database database)
Register database objects used by this identifier generator, e.g.
|
default boolean |
supportsJdbcBatchInserts()
Check if JDBC batch inserts are supported.
|
static final String ENTITY_NAME
static final String JPA_ENTITY_NAME
static final String GENERATOR_NAME
GeneratedValue.generator() to the
IdentifierGenerator as it is configured.default void configure(Type type, Properties params, ServiceRegistry serviceRegistry) throws MappingException
This method is called just once, following instantiation, and before registerExportables(Database).
configure in interface Configurabletype - The id property type descriptorparams - param values, keyed by parameter nameserviceRegistry - Access to service that may be needed.MappingException - If configuration fails.default void registerExportables(Database database)
This method is called just once, after configure(Type, Properties, ServiceRegistry).
registerExportables in interface ExportableProducerdatabase - The database instancedefault void initialize(SqlStringGenerationContext context)
This method is called after registerExportables(Database), before first use.
context - A context to help generate SQL stringsSerializable generate(SharedSessionContractImplementor session, Object object) throws HibernateException
session - The session from which the request originatesobject - the entity or collection (idbag) for which the id is being generatedHibernateException - Indicates trouble generating the identifierdefault boolean supportsJdbcBatchInserts()
Copyright © 2001-2021 Red Hat, Inc. All Rights Reserved.