Top Description Fields Constructors Methods
org.hibernate.id.factory.internal

public Class DefaultIdentifierGeneratorFactory

extends Object
implements MutableIdentifierGeneratorFactory, Serializable, ServiceRegistryAwareService
Class Inheritance
All Implemented Interfaces
org.hibernate.service.spi.ServiceRegistryAwareService, java.io.Serializable, org.hibernate.id.factory.spi.MutableIdentifierGeneratorFactory, org.hibernate.service.Service, org.hibernate.id.factory.IdentifierGeneratorFactory
Annotations
@SuppressWarnings:deprecation, rawtypes, serial
Imports
java.io.Serializable, java.util.Properties, java.util.concurrent.ConcurrentHashMap, org.hibernate.MappingException, org.hibernate.boot.registry.classloading.spi.ClassLoaderService, .ClassLoadingException, org.hibernate.cfg.AvailableSettings, org.hibernate.dialect.Dialect, org.hibernate.engine.config.spi.ConfigurationService, .StandardConverters, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment, org.hibernate.id.Assigned, .ForeignGenerator, .GUIDGenerator, .IdentifierGenerator, .IdentityGenerator, .IncrementGenerator, .SelectGenerator, .SequenceGenerator, .SequenceHiLoGenerator, .SequenceIdentityGenerator, .UUIDGenerator, .UUIDHexGenerator, org.hibernate.id.enhanced.SequenceStyleGenerator, .TableGenerator, org.hibernate.id.factory.spi.MutableIdentifierGeneratorFactory, org.hibernate.internal.CoreLogging, .CoreMessageLogger, org.hibernate.resource.beans.container.spi.BeanContainer, org.hibernate.resource.beans.internal.FallbackBeanInstanceProducer, org.hibernate.resource.beans.spi.ManagedBeanRegistry, org.hibernate.service.ServiceRegistry, org.hibernate.service.spi.ServiceRegistryAwareService, .ServiceRegistryImplementor, org.hibernate.type.Type

Basic templated support for org.hibernate.id.factory.IdentifierGeneratorFactory implementations.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private BeanContainer
private Dialect
private final ConcurrentHashMap<String, Class<T>>
private final boolean
private static final CoreMessageLogger
private ServiceRegistry

Constructor Summary

AccessConstructor and Description
public
DefaultIdentifierGeneratorFactory()

Constructs a new DefaultIdentifierGeneratorFactory.

public
DefaultIdentifierGeneratorFactory(boolean ignoreBeanContainer)

Allows to explicitly control if the BeanContainer should be ignored (if there is one registered) when initializing any new IdentifierGenerator instances.

Method Summary

Modifier and TypeMethod and Description
public IdentifierGenerator
createIdentifierGenerator(String
The generation strategy.
strategy
,
Type
The mapping type for the identifier values.
type
,
Properties
Any configuration properties given in the generator mapping.
config
)

Implements org.hibernate.id.factory.IdentifierGeneratorFactory.createIdentifierGenerator.

Deprecated as a consequence of IdentifierGenerator being deprecated.
Given a strategy, retrieve the appropriate identifier generator instance.
public Dialect
public Class<T>
getIdentifierGeneratorClass(String
The strategy
strategy
)

Implements org.hibernate.id.factory.IdentifierGeneratorFactory.getIdentifierGeneratorClass.

Retrieve the class that will be used as the IdentifierGenerator for the given strategy.
public void
injectServices(ServiceRegistryImplementor
The registry
serviceRegistry
)

Implements org.hibernate.service.spi.ServiceRegistryAwareService.injectServices.

Callback to inject the registry.
public void
public void
setDialect(Dialect
The dialect
dialect
)

Implements org.hibernate.id.factory.IdentifierGeneratorFactory.setDialect.

Allow injection of the dialect to use.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

beanContainerback to summary
private BeanContainer beanContainer
dialectback to summary
private Dialect dialect
generatorStrategyToClassNameMapback to summary
private final ConcurrentHashMap<String, Class<T>> generatorStrategyToClassNameMap
ignoreBeanContainerback to summary
private final boolean ignoreBeanContainer
LOGback to summary
private static final CoreMessageLogger LOG
serviceRegistryback to summary
private ServiceRegistry serviceRegistry

Constructor Detail

DefaultIdentifierGeneratorFactoryback to summary
public DefaultIdentifierGeneratorFactory()

Constructs a new DefaultIdentifierGeneratorFactory.

DefaultIdentifierGeneratorFactoryback to summary
public DefaultIdentifierGeneratorFactory(boolean ignoreBeanContainer)

Allows to explicitly control if the BeanContainer should be ignored (if there is one registered) when initializing any new IdentifierGenerator instances.

Method Detail

createIdentifierGeneratorback to summary
public IdentifierGenerator createIdentifierGenerator(String strategy, Type type, Properties config)

Implements org.hibernate.id.factory.IdentifierGeneratorFactory.createIdentifierGenerator.

Doc from org.hibernate.id.factory.IdentifierGeneratorFactory.createIdentifierGenerator.

Deprecated

as a consequence of IdentifierGenerator being deprecated. See corresponding docs for further information.

Given a strategy, retrieve the appropriate identifier generator instance.

Parameters
strategy:String

The generation strategy.

type:Type

The mapping type for the identifier values.

config:Properties

Any configuration properties given in the generator mapping.

Returns:IdentifierGenerator

The appropriate generator instance.

Annotations
@SuppressWarnings:unchecked
@Override
getDialectback to summary
public Dialect getDialect()

Implements org.hibernate.id.factory.IdentifierGeneratorFactory.getDialect.

Doc from org.hibernate.id.factory.IdentifierGeneratorFactory.getDialect.

Get the dialect.

Returns:Dialect

the dialect

Annotations
@Override
getIdentifierGeneratorClassback to summary
public Class<T> getIdentifierGeneratorClass(String strategy)

Implements org.hibernate.id.factory.IdentifierGeneratorFactory.getIdentifierGeneratorClass.

Doc from org.hibernate.id.factory.IdentifierGeneratorFactory.getIdentifierGeneratorClass.

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

Parameters
strategy:String

The strategy

Returns:Class<T>

The generator class.

Annotations
@Override
injectServicesback to summary
public void injectServices(ServiceRegistryImplementor serviceRegistry)

Implements org.hibernate.service.spi.ServiceRegistryAwareService.injectServices.

Doc from org.hibernate.service.spi.ServiceRegistryAwareService.injectServices.

Callback to inject the registry.

Parameters
serviceRegistry:ServiceRegistryImplementor

The registry

Annotations
@Override
registerback to summary
public void register(String strategy, Class<T> generatorClass)

Implements org.hibernate.id.factory.spi.MutableIdentifierGeneratorFactory.register.

setDialectback to summary
public void setDialect(Dialect dialect)

Implements org.hibernate.id.factory.IdentifierGeneratorFactory.setDialect.

Doc from org.hibernate.id.factory.IdentifierGeneratorFactory.setDialect.

Allow injection of the dialect to use.

Parameters
dialect:Dialect

The dialect

Annotations
@Override