public interface IdentifierGenerator
The general contract between a class that generates unique identifiers and the <tt>Session</tt>. It is not intended that this interface ever be exposed to the application. It <b>is</b> intended that users implement this interface to provide custom identifier generation strategies.<br> <br> Implementors should provide a public default constructor.<br> <br> Implementations that accept configuration parameters should also implement <tt>Configurable</tt>. <br> Implementors <em>must</em> be thread-safe
PersistentIdentifierGenerator,
Configurable| 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 |
|---|---|
Serializable |
generate(SharedSessionContractImplementor session,
Object object)
Generate a new identifier.
|
static final String ENTITY_NAME
The configuration parameter holding the entity name
static final String JPA_ENTITY_NAME
The configuration parameter holding the JPA entity name
static final String GENERATOR_NAME
Used as a key to pass the name used as GeneratedValue.generator() to the
IdentifierGenerator as it is configured.
Serializable generate(SharedSessionContractImplementor session, Object object) throws HibernateException
Generate a new identifier.
session - The session from which the request originatesobject - the entity or collection (idbag) for which the id is being generatedHibernateException - Indicates trouble generating the identifierCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.