Package org.hibernate.reactive.id.impl
Class ReactiveSequenceIdentifierGenerator
java.lang.Object
org.hibernate.reactive.id.impl.BlockingIdentifierGenerator
org.hibernate.reactive.id.impl.ReactiveSequenceIdentifierGenerator
- All Implemented Interfaces:
Serializable,org.hibernate.boot.model.relational.ExportableProducer,org.hibernate.generator.BeforeExecutionGenerator,org.hibernate.generator.Generator,org.hibernate.id.Configurable,org.hibernate.id.IdentifierGenerator,ReactiveIdentifierGenerator<Long>
public class ReactiveSequenceIdentifierGenerator
extends BlockingIdentifierGenerator
implements org.hibernate.id.IdentifierGenerator
Support for JPA's
SequenceGenerator.
This implementation supports block allocation, but does not guarantee that generated identifiers are sequential.
- See Also:
-
Field Summary
FieldsFields inherited from interface org.hibernate.id.IdentifierGenerator
CONTRIBUTOR_NAME, ENTITY_NAME, GENERATOR_NAME, JPA_ENTITY_NAME -
Constructor Summary
ConstructorsConstructorDescriptionReactiveSequenceIdentifierGenerator(org.hibernate.id.enhanced.DatabaseStructure structure, org.hibernate.metamodel.spi.RuntimeModelCreationContext creationContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(org.hibernate.type.Type type, Properties properties, org.hibernate.service.ServiceRegistry serviceRegistry) protected intprotected org.hibernate.boot.model.relational.QualifiedNamedetermineSequenceName(Properties params, org.hibernate.dialect.Dialect dialect, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment jdbcEnv, org.hibernate.service.ServiceRegistry serviceRegistry) Determine the name of the sequence (or table if this resolves to a physical table) to use.protected intThe block size (the number of "lo" values for each "hi" value)org.hibernate.boot.model.relational.QualifiedNamevoidinitialize(org.hibernate.boot.model.relational.SqlStringGenerationContext context) protected CompletionStage<Long>nextHiValue(ReactiveConnectionSupplier session) Allocate a new block, by obtaining the next "hi" value from the databaseMethods inherited from class org.hibernate.reactive.id.impl.BlockingIdentifierGenerator
generateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.generator.BeforeExecutionGenerator
generatedOnExecutionMethods inherited from interface org.hibernate.id.Configurable
configureMethods inherited from interface org.hibernate.generator.Generator
allowAssignedIdentifiers, allowMutation, generatedBeforeExecution, generatedOnExecution, generatesOnForceIncrement, generatesOnInsert, generatesOnUpdate, generatesSometimesMethods inherited from interface org.hibernate.id.IdentifierGenerator
generate, getEventTypes, registerExportablesMethods inherited from interface org.hibernate.reactive.id.ReactiveIdentifierGenerator
generate
-
Field Details
-
NO_PARAMS
-
-
Constructor Details
-
ReactiveSequenceIdentifierGenerator
public ReactiveSequenceIdentifierGenerator() -
ReactiveSequenceIdentifierGenerator
public ReactiveSequenceIdentifierGenerator(org.hibernate.id.enhanced.DatabaseStructure structure, org.hibernate.metamodel.spi.RuntimeModelCreationContext creationContext)
-
-
Method Details
-
getBlockSize
protected int getBlockSize()Description copied from class:BlockingIdentifierGeneratorThe block size (the number of "lo" values for each "hi" value)- Specified by:
getBlockSizein classBlockingIdentifierGenerator
-
nextHiValue
Description copied from class:BlockingIdentifierGeneratorAllocate a new block, by obtaining the next "hi" value from the database- Specified by:
nextHiValuein classBlockingIdentifierGenerator
-
configure
public void configure(org.hibernate.type.Type type, Properties properties, org.hibernate.service.ServiceRegistry serviceRegistry) - Specified by:
configurein interfaceorg.hibernate.id.Configurable- Specified by:
configurein interfaceorg.hibernate.id.IdentifierGenerator
-
determineSequenceName
protected org.hibernate.boot.model.relational.QualifiedName determineSequenceName(Properties params, org.hibernate.dialect.Dialect dialect, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment jdbcEnv, org.hibernate.service.ServiceRegistry serviceRegistry) Determine the name of the sequence (or table if this resolves to a physical table) to use.Called during configuration.
- Parameters:
params- The params supplied in the generator config (plus some standard useful extras).dialect- The dialect in effectjdbcEnv- The JdbcEnvironment- Returns:
- The sequence name
- See Also:
-
SequenceStyleGenerator#determineSequenceName(Properties, Dialect, JdbcEnvironment, ServiceRegistry)
-
initialize
public void initialize(org.hibernate.boot.model.relational.SqlStringGenerationContext context) - Specified by:
initializein interfaceorg.hibernate.id.Configurable
-
getSequenceName
public org.hibernate.boot.model.relational.QualifiedName getSequenceName() -
determineIncrementForSequenceEmulation
-