Package org.hibernate.id
This package and its subpackages, especially
org.hibernate.id.enhanced,
contain the built-in id generators, all of which implement either
IdentifierGenerator or
PostInsertIdentifierGenerator.
The most useful id generators in modern Hibernate are:
IdentityGenerator-@GeneratedValue(strategy=IDENTITY)SequenceStyleGenerator-@GeneratedValue(strategy=SEQUENCE)TableGenerator-@GeneratedValue(strategy=TABLE)UuidGenerator-@UuidGenerator
- See Also:
org.hibernate.generator- API Note:
- The remaining id generators are kept around for backward compatibility
and as an implementation detail of the
hbm.xmlmapping format.
-
Interface Summary Interface Description BulkInsertionCapableIdentifierGenerator Specialized contract forIdentifierGeneratorimplementations capable of being used in conjunction with HQL insert statements.CompositeNestedGeneratedValueGenerator.GenerationContextLocator Contract for declaring how to locate the context for sub-value injection.CompositeNestedGeneratedValueGenerator.GenerationPlan Contract for performing the actual sub-value generation, usually injecting it into the determined contextConfigurable AGeneratorthat supports "configuration".IdentifierGenerator A classic extension point from the very earliest days of Hibernate, this interface is no longer the only way to generate identifiers.IdentifierGeneratorAggregator Identifies generators which potentially aggregate otherPersistentIdentifierGeneratorgenerators.IntegralDataTypeHolder Defines a common API for dealing with data of integral data type.OptimizableGenerator Commonality between sequence-based and table-based generatorsPersistentIdentifierGenerator AnIdentifierGeneratorthat requires creation of database objects.PostInsertIdentifierGenerator The counterpart toIdentifierGeneratorfor values generated by the database.PostInsertIdentityPersister Deprecated, for removal: This API element is subject to removal in a future version. UseEntityPersisterinstead.ResultSetIdentifierConsumer Deprecated, for removal: This API element is subject to removal in a future version. this interface is unnecessary and no longer usedUUIDGenerationStrategy Deprecated. seeUUIDGenerator -
Class Summary Class Description AbstractPostInsertGenerator Deprecated, for removal: This API element is subject to removal in a future version. Subclasses should now directly inheritPostInsertIdentifierGeneratorandBulkInsertionCapableIdentifierGenerator, or even better, simply implementOnExecutionGeneratordirectly.AbstractUUIDGenerator Deprecated. sinceUUIDHexGeneratoris deprecatedAssigned AnIdentifierGeneratorthat returns the current identifier assigned to an instance.CompositeNestedGeneratedValueGenerator For composite identifiers, defines a number of "nested" generations that need to happen to "fill" the identifier property(s).ExportableColumn ExportableColumn.ValueImpl ForeignGenerator Deprecated, for removal: This API element is subject to removal in a future version. This remains around as an implementation detail ofhbm.xmlmappings.GUIDGenerator Deprecated. useUuidGeneratorIdentifierGeneratorHelper Factory and helper methods forIdentifierGeneratorframework.IdentifierGeneratorHelper.BasicHolder IdentifierGeneratorHelper.BigDecimalHolder IdentifierGeneratorHelper.BigIntegerHolder IdentityGenerator AnOnExecutionGeneratorthat handlesIDENTITY/"autoincrement" columns on those databases which support them.IncrementGenerator AnIdentifierGeneratorthat returns along, constructed by counting from the maximum primary key value obtained by querying the table or tables at startup.SelectGenerator A generator thatselects the just-inserted row to determine the column value assigned by the database.UUIDGenerator Deprecated. useUuidGeneratorandUuidGeneratorinsteadUUIDHexGenerator Deprecated. This remains around as an implementation detail ofhbm.xmlmappings. -
Enum Summary Enum Description EntityIdentifierNature Describes the possible natures of an entity-defined identifier.SequenceMismatchStrategy Describes the strategy for handling the mismatch between a database sequence configuration and the one defined by the entity mapping. -
Exception Summary Exception Description IdentifierGenerationException Thrown by anIdentifierGeneratorimplementation class when ID generation fails.