Package org.hibernate.id
Class AbstractPostInsertGenerator
- java.lang.Object
-
- org.hibernate.id.AbstractPostInsertGenerator
-
- All Implemented Interfaces:
ExportableProducer
,BulkInsertionCapableIdentifierGenerator
,Configurable
,IdentifierGenerator
,PostInsertIdentifierGenerator
- Direct Known Subclasses:
IdentityGenerator
,SelectGenerator
public abstract class AbstractPostInsertGenerator extends java.lang.Object implements PostInsertIdentifierGenerator, BulkInsertionCapableIdentifierGenerator
Basic implementation of thePostInsertIdentifierGenerator
contract.
-
-
Field Summary
-
Fields inherited from interface org.hibernate.id.IdentifierGenerator
ENTITY_NAME, GENERATOR_NAME, JPA_ENTITY_NAME
-
-
Constructor Summary
Constructors Constructor Description AbstractPostInsertGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
determineBulkInsertionIdentifierGenerationSelectFragment(SqlStringGenerationContext context)
Return the select expression fragment, if any, that generates the identifier values.java.io.Serializable
generate(SharedSessionContractImplementor s, java.lang.Object obj)
Generate a new identifier.boolean
supportsBulkInsertionIdentifierGeneration()
Given the configuration of this generator, is identifier generation as part of bulk insertion supported?-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.id.BulkInsertionCapableIdentifierGenerator
determineBulkInsertionIdentifierGenerationSelectFragment
-
Methods inherited from interface org.hibernate.id.IdentifierGenerator
configure, initialize, registerExportables
-
Methods inherited from interface org.hibernate.id.PostInsertIdentifierGenerator
getInsertGeneratedIdentifierDelegate, supportsJdbcBatchInserts
-
-
-
-
Method Detail
-
generate
public java.io.Serializable generate(SharedSessionContractImplementor s, java.lang.Object obj)
Description copied from interface:IdentifierGenerator
Generate a new identifier.- Specified by:
generate
in interfaceIdentifierGenerator
- Parameters:
s
- The session from which the request originatesobj
- the entity or collection (idbag) for which the id is being generated- Returns:
- a new identifier
-
supportsBulkInsertionIdentifierGeneration
public boolean supportsBulkInsertionIdentifierGeneration()
Description copied from interface:BulkInsertionCapableIdentifierGenerator
Given the configuration of this generator, is identifier generation as part of bulk insertion supported? IMPL NOTE : Mainly here to allow stuff like SequenceStyleGenerator which *can* support this based on configuration- Specified by:
supportsBulkInsertionIdentifierGeneration
in interfaceBulkInsertionCapableIdentifierGenerator
- Returns:
true
if bulk insertions are supported;false
otherwise.
-
determineBulkInsertionIdentifierGenerationSelectFragment
public java.lang.String determineBulkInsertionIdentifierGenerationSelectFragment(SqlStringGenerationContext context)
Description copied from interface:BulkInsertionCapableIdentifierGenerator
Return the select expression fragment, if any, that generates the identifier values.- Specified by:
determineBulkInsertionIdentifierGenerationSelectFragment
in interfaceBulkInsertionCapableIdentifierGenerator
- Parameters:
context
- A context for SQL string generation.- Returns:
- The identifier value generation fragment (SQL).
null
indicates that no fragment is needed.
-
-