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 Object implements PostInsertIdentifierGenerator, BulkInsertionCapableIdentifierGenerator
Basic implementation of thePostInsertIdentifierGeneratorcontract.
-
-
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 StringdetermineBulkInsertionIdentifierGenerationSelectFragment(SqlStringGenerationContext context)Return the select expression fragment, if any, that generates the identifier values.Serializablegenerate(SharedSessionContractImplementor s, Object obj)Generate a new identifier.booleansupportsBulkInsertionIdentifierGeneration()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 Serializable generate(SharedSessionContractImplementor s, Object obj)
Description copied from interface:IdentifierGeneratorGenerate a new identifier.- Specified by:
generatein 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:BulkInsertionCapableIdentifierGeneratorGiven 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:
supportsBulkInsertionIdentifierGenerationin interfaceBulkInsertionCapableIdentifierGenerator- Returns:
trueif bulk insertions are supported;falseotherwise.
-
determineBulkInsertionIdentifierGenerationSelectFragment
public String determineBulkInsertionIdentifierGenerationSelectFragment(SqlStringGenerationContext context)
Description copied from interface:BulkInsertionCapableIdentifierGeneratorReturn the select expression fragment, if any, that generates the identifier values.- Specified by:
determineBulkInsertionIdentifierGenerationSelectFragmentin interfaceBulkInsertionCapableIdentifierGenerator- Parameters:
context- A context for SQL string generation.- Returns:
- The identifier value generation fragment (SQL).
nullindicates that no fragment is needed.
-
-