Top Description Methods
org.hibernate.id.factory

public Interface IdentifierGeneratorFactory

extends Service
Known Direct Implementers
org.hibernate.id.factory.internal.StandardIdentifierGeneratorFactory
Annotations
@Incubating
Imports
java.util.Properties, org.hibernate.Incubating, org.hibernate.dialect.Dialect, org.hibernate.id.IdentifierGenerator, org.hibernate.id.factory.spi.GeneratorDefinitionResolver, org.hibernate.service.Service, .ServiceRegistry, org.hibernate.generator.Generator, org.hibernate.type.Type, org.hibernate.type.descriptor.java.JavaType, jakarta.persistence.GenerationType

Contract for a factory of IdentifierGenerator instances. The implementor of this service is responsible for providing implementations of the predefined built-in id generators, all of which implement IdentifierGenerator, along with any id generator declared using org.hibernate.annotations.GenericGenerator.

An id generator is identified by either:

A new generator passed a Properties object containing parameters via the method IdentifierGenerator#configure(Type, Properties, ServiceRegistry).

This is part of an older mechanism for instantiating and configuring id generators which predates the existence of Generator and the @IdGeneratorType meta-annotation.

Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public Generator
createIdentifierGenerator(GenerationType generationType, String generatedValueGeneratorName, String generatorName, JavaType<?> javaType, Properties config, GeneratorDefinitionResolver definitionResolver)

Create an IdentifierGenerator based on the given details.

public Generator

Returns:

The appropriate generator instance.
createIdentifierGenerator
(String
The generation strategy.
strategy
,
Type
The mapping type for the identifier values.
type
,
Properties
Any parameters properties given in the generator mapping.
parameters
)

Given a strategy, retrieve the appropriate identifier generator instance.
public Dialect

Returns:

the dialect
getDialect
()

Deprecated for removal since 6.2. should be removed
Get the dialect.
public Class<? extends Generator>

Returns:

The generator class.
getIdentifierGeneratorClass
(String
The strategy
strategy
)

Deprecated since 6.0. with no replacement.
Retrieve the class that will be used as the IdentifierGenerator for the given strategy.

Method Detail

createIdentifierGeneratorback to summary
public Generator createIdentifierGenerator(GenerationType generationType, String generatedValueGeneratorName, String generatorName, JavaType<?> javaType, Properties config, GeneratorDefinitionResolver definitionResolver)

Create an IdentifierGenerator based on the given details.

Annotations
@Incubating
createIdentifierGeneratorback to summary
public Generator createIdentifierGenerator(String strategy, Type type, Properties parameters)

Given a strategy, retrieve the appropriate identifier generator instance.

Parameters
strategy:String

The generation strategy.

type:Type

The mapping type for the identifier values.

parameters:Properties

Any parameters properties given in the generator mapping.

Returns:Generator

The appropriate generator instance.

Annotations
@Deprecated
since:6.0
getDialectback to summary
public Dialect getDialect()

Deprecated

for removal since 6.2.

should be removed

Get the dialect.

Returns:Dialect

the dialect

Annotations
@Deprecated
since:6.2
forRemoval:true
getIdentifierGeneratorClassback to summary
public Class<? extends Generator> getIdentifierGeneratorClass(String strategy)

Retrieve the class that will be used as the IdentifierGenerator for the given strategy.

Parameters
strategy:String

The strategy

Returns:Class<? extends Generator>

The generator class.

Annotations
@Deprecated
since:6.0