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

public Class DefaultIdentifierGeneratorFactory

extends Object
implements IdentifierGeneratorFactory, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.hibernate.id.factory.IdentifierGeneratorFactory
Imports
java.util.Properties, java.io.Serializable, java.util.concurrent.ConcurrentHashMap, org.slf4j.Logger, .LoggerFactory, org.hibernate.id.IdentifierGenerator, .UUIDGenerator, .UUIDHexGenerator, .TableHiLoGenerator, .Assigned, .IdentityGenerator, .SelectGenerator, .SequenceGenerator, .SequenceHiLoGenerator, .IncrementGenerator, .ForeignGenerator, .GUIDGenerator, .SequenceIdentityGenerator, .Configurable, org.hibernate.id.enhanced.SequenceStyleGenerator, .TableGenerator, org.hibernate.type.Type, org.hibernate.util.ReflectHelper, org.hibernate.dialect.Dialect, org.hibernate.MappingException

Basic templated support for IdentifierGeneratorFactory implementations.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private transient Dialect
private ConcurrentHashMap<String, Class<T>>
private static final Logger

Constructor Summary

AccessConstructor and Description
public
DefaultIdentifierGeneratorFactory()

Constructs a new DefaultIdentifierGeneratorFactory.

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 configuraion properties given in the generator mapping.
config
)

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

Given a strategy, retrieve the appropriate identifier generator instance.
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
register(String strategy, Class<T> generatorClass)

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

dialectback to summary
private transient Dialect dialect
generatorStrategyToClassNameMapback to summary
private ConcurrentHashMap<String, Class<T>> generatorStrategyToClassNameMap
logback to summary
private static final Logger log

Constructor Detail

DefaultIdentifierGeneratorFactoryback to summary
public DefaultIdentifierGeneratorFactory()

Constructs a new DefaultIdentifierGeneratorFactory.

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.

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 configuraion properties given in the generator mapping.

Returns:IdentifierGenerator

The appropriate generator instance.

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.

registerback to summary
public void register(String strategy, Class<T> generatorClass)
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