Package org.hibernate.id
Interface IdentifierGenerator
-
- All Known Subinterfaces:
BulkInsertionCapableIdentifierGenerator
,PersistentIdentifierGenerator
,PostInsertIdentifierGenerator
- All Known Implementing Classes:
AbstractPostInsertGenerator
,AbstractUUIDGenerator
,Assigned
,CompositeNestedGeneratedValueGenerator
,ForeignGenerator
,GUIDGenerator
,IdentityGenerator
,IncrementGenerator
,MultipleHiLoPerTableGenerator
,SelectGenerator
,SequenceGenerator
,SequenceHiLoGenerator
,SequenceIdentityGenerator
,SequenceStyleGenerator
,TableGenerator
,UUIDGenerator
,UUIDHexGenerator
public interface IdentifierGenerator
The general contract between a class that generates unique identifiers and the Session. It is not intended that this interface ever be exposed to the application. It is intended that users implement this interface to provide custom identifier generation strategies.
Implementors should provide a public default constructor.
Implementations that accept configuration parameters should also implement Configurable.
Implementors must be thread-safe- See Also:
PersistentIdentifierGenerator
,Configurable
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ENTITY_NAME
The configuration parameter holding the entity namestatic java.lang.String
GENERATOR_NAME
Used as a key to pass the name used asGeneratedValue.generator()
to theIdentifierGenerator
as it is configured.static java.lang.String
JPA_ENTITY_NAME
The configuration parameter holding the JPA entity name
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.io.Serializable
generate(SharedSessionContractImplementor session, java.lang.Object object)
Generate a new identifier.default boolean
supportsJdbcBatchInserts()
Check if JDBC batch inserts are supported.
-
-
-
Field Detail
-
ENTITY_NAME
static final java.lang.String ENTITY_NAME
The configuration parameter holding the entity name- See Also:
- Constant Field Values
-
JPA_ENTITY_NAME
static final java.lang.String JPA_ENTITY_NAME
The configuration parameter holding the JPA entity name- See Also:
- Constant Field Values
-
GENERATOR_NAME
static final java.lang.String GENERATOR_NAME
Used as a key to pass the name used asGeneratedValue.generator()
to theIdentifierGenerator
as it is configured.- See Also:
- Constant Field Values
-
-
Method Detail
-
generate
java.io.Serializable generate(SharedSessionContractImplementor session, java.lang.Object object) throws HibernateException
Generate a new identifier.- Parameters:
session
- The session from which the request originatesobject
- the entity or collection (idbag) for which the id is being generated- Returns:
- a new identifier
- Throws:
HibernateException
- Indicates trouble generating the identifier
-
supportsJdbcBatchInserts
default boolean supportsJdbcBatchInserts()
Check if JDBC batch inserts are supported.- Returns:
- JDBC batch inserts are supported.
-
-