Package org.hibernate.id
Interface Configurable
-
- All Known Subinterfaces:
IdentifierGenerator
,OptimizableGenerator
,PersistentIdentifierGenerator
,PostInsertIdentifierGenerator
- All Known Implementing Classes:
AbstractPostInsertGenerator
,AbstractUUIDGenerator
,Assigned
,CompositeNestedGeneratedValueGenerator
,ForeignGenerator
,GUIDGenerator
,IdentityGenerator
,IncrementGenerator
,OrderedSequenceGenerator
,SelectGenerator
,SequenceStyleGenerator
,TableGenerator
,UUIDGenerator
,UUIDHexGenerator
public interface Configurable
AGenerator
that supports "configuration".- API Note:
- Prefer instead using either
- IdGeneratorType , or
- AnnotationBasedGenerator (in either implementation or constructor-injection form)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
configure(Type type, Properties parameters, ServiceRegistry serviceRegistry)
Configure this instance, given the value of parameters specified by the user as XML<param>
elements and@Parameter
annotations.default void
create(GeneratorCreationContext creationContext)
Deprecated, for removal: This API element is subject to removal in a future version.Added in 6.6 as a short-term work-around, but should really use on of the alternatives discussed at Configurable.default void
initialize(SqlStringGenerationContext context)
Initializes this instance, pre-generating SQL if necessary.
-
-
-
Method Detail
-
create
@Deprecated(forRemoval=true) default void create(GeneratorCreationContext creationContext) throws MappingException
Deprecated, for removal: This API element is subject to removal in a future version.Added in 6.6 as a short-term work-around, but should really use on of the alternatives discussed at Configurable. See HHH-18615.Called beforeconfigure(Type, Properties, ServiceRegistry)
, with an instance ofGeneratorCreationContext
.- Throws:
MappingException
- Since:
- 6.6
-
configure
void configure(Type type, Properties parameters, ServiceRegistry serviceRegistry) throws MappingException
Configure this instance, given the value of parameters specified by the user as XML<param>
elements and@Parameter
annotations.This method is called just once, following instantiation. If this instance also implements
ExportableProducer
, then this method is always called beforeExportableProducer.registerExportables(Database)
,- Parameters:
type
- The id property type descriptorparameters
- param values, keyed by parameter nameserviceRegistry
- Access to service that may be needed.- Throws:
MappingException
- when there's something wrong with the given parameters
-
initialize
default void initialize(SqlStringGenerationContext context)
Initializes this instance, pre-generating SQL if necessary.If this instance also implements
ExportableProducer
, then this method is always called afterExportableProducer.registerExportables(Database)
, and before first use.- Parameters:
context
- A context to help generate SQL strings
-
-