Package org.hibernate.id.factory
Interface IdentifierGeneratorFactory
-
- All Superinterfaces:
Serializable
,Service
- All Known Implementing Classes:
StandardIdentifierGeneratorFactory
@Incubating public interface IdentifierGeneratorFactory extends Service
Contract for a factory ofIdentifierGenerator
instances. The implementor of this service is responsible for providing implementations of the predefined built-in id generators, all of which implementIdentifierGenerator
, along with any id generator declared usingGenericGenerator
.An id generator is identified by either:
- a predefined string-based name (which originated in the old
hbm.xml
mapping file format), - the
name
or the thetype
specified by the@GenericGenerator
annotation, or - a JPA-defined
GenerationType
.
A new generator passed a
Properties
object containing parameters via the methodIdentifierGenerator.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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Generator
createIdentifierGenerator(GenerationType generationType, String generatedValueGeneratorName, String generatorName, JavaType<?> javaType, Properties config, GeneratorDefinitionResolver definitionResolver)
Create anIdentifierGenerator
based on the given details.Generator
createIdentifierGenerator(String strategy, Type type, Properties parameters)
Dialect
getDialect()
Deprecated, for removal: This API element is subject to removal in a future version.should be removedClass<? extends Generator>
getIdentifierGeneratorClass(String strategy)
Deprecated.with no replacement.
-
-
-
Method Detail
-
createIdentifierGenerator
@Incubating Generator createIdentifierGenerator(GenerationType generationType, String generatedValueGeneratorName, String generatorName, JavaType<?> javaType, Properties config, GeneratorDefinitionResolver definitionResolver)
Create anIdentifierGenerator
based on the given details.
-
createIdentifierGenerator
@Deprecated(since="6.0") Generator createIdentifierGenerator(String strategy, Type type, Properties parameters)
Deprecated.Given a strategy, retrieve the appropriate identifier generator instance.- Parameters:
strategy
- The generation strategy.type
- The mapping type for the identifier values.parameters
- Any parameters properties given in the generator mapping.- Returns:
- The appropriate generator instance.
-
getIdentifierGeneratorClass
@Deprecated(since="6.0") Class<? extends Generator> getIdentifierGeneratorClass(String strategy)
Deprecated.Retrieve the class that will be used as theIdentifierGenerator
for the given strategy.- Parameters:
strategy
- The strategy- Returns:
- The generator class.
-
getDialect
@Deprecated(since="6.2", forRemoval=true) Dialect getDialect()
Deprecated, for removal: This API element is subject to removal in a future version.should be removedGet the dialect.- Returns:
- the dialect
-
-