public class CompositeNestedGeneratedValueGenerator extends Object implements IdentifierGenerator, Serializable, IdentifierGeneratorAggregator
<composite-id/> (notice the lack of both a name and class attribute
declarations). The term "embedded"
here refers to the Hibernate usage which is actually the exact opposite of the JPA
meaning of "embedded". Essentially this means that the entity class itself holds
the named composite pk properties. This is very similar to the JPA @IdClass
usage, though without a separate pk-class for loading.
@EmbeddedId)
and HBM mappings (<composite-id name="idAttributeName" class="PkClassName"/>)
@IdClass use case
and is only possible in annotations
Component.| Modifier and Type | Class and Description |
|---|---|
static interface |
CompositeNestedGeneratedValueGenerator.GenerationContextLocator
Contract for declaring how to locate the context for sub-value injection.
|
static interface |
CompositeNestedGeneratedValueGenerator.GenerationPlan
Contract for performing the actual sub-value generation, usually injecting it into the
determined
context |
ENTITY_NAME, GENERATOR_NAME, JPA_ENTITY_NAME| Constructor and Description |
|---|
CompositeNestedGeneratedValueGenerator(CompositeNestedGeneratedValueGenerator.GenerationContextLocator generationContextLocator) |
| Modifier and Type | Method and Description |
|---|---|
void |
addGeneratedValuePlan(CompositeNestedGeneratedValueGenerator.GenerationPlan plan) |
Serializable |
generate(SharedSessionContractImplementor session,
Object object)
Generate a new identifier.
|
void |
initialize(SqlStringGenerationContext context)
Initializes this instance, in particular pre-generates SQL as necessary.
|
void |
registerExportables(Database database)
Register database objects used by this identifier generator, e.g.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconfigure, supportsJdbcBatchInsertspublic CompositeNestedGeneratedValueGenerator(CompositeNestedGeneratedValueGenerator.GenerationContextLocator generationContextLocator)
public void addGeneratedValuePlan(CompositeNestedGeneratedValueGenerator.GenerationPlan plan)
public Serializable generate(SharedSessionContractImplementor session, Object object) throws HibernateException
IdentifierGeneratorgenerate in interface IdentifierGeneratorsession - The session from which the request originatesobject - the entity or collection (idbag) for which the id is being generatedHibernateException - Indicates trouble generating the identifierpublic void registerExportables(Database database)
IdentifierGenerator
This method is called just once, after IdentifierGenerator.configure(Type, Properties, ServiceRegistry).
registerExportables in interface ExportableProducerregisterExportables in interface IdentifierGeneratordatabase - The database instancepublic void initialize(SqlStringGenerationContext context)
IdentifierGenerator
This method is called after IdentifierGenerator.registerExportables(Database), before first use.
initialize in interface IdentifierGeneratorcontext - A context to help generate SQL stringsCopyright © 2001-2021 Red Hat, Inc. All Rights Reserved.