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, JPA_ENTITY_NAME
Constructor and Description |
---|
CompositeNestedGeneratedValueGenerator(CompositeNestedGeneratedValueGenerator.GenerationContextLocator generationContextLocator) |
Modifier and Type | Method and Description |
---|---|
void |
addGeneratedValuePlan(CompositeNestedGeneratedValueGenerator.GenerationPlan plan) |
Serializable |
generate(SessionImplementor session,
Object object)
Generate a new identifier.
|
void |
registerPersistentGenerators(Map generatorMap)
Register any sub generators which implement
PersistentIdentifierGenerator by their
generatorKey . |
public CompositeNestedGeneratedValueGenerator(CompositeNestedGeneratedValueGenerator.GenerationContextLocator generationContextLocator)
public void addGeneratedValuePlan(CompositeNestedGeneratedValueGenerator.GenerationPlan plan)
public Serializable generate(SessionImplementor session, Object object) throws HibernateException
IdentifierGenerator
generate
in interface IdentifierGenerator
object
- the entity or toplevel collection for which the id is being generatedHibernateException
public void registerPersistentGenerators(Map generatorMap)
PersistentIdentifierGenerator
by their
generatorKey
.registerPersistentGenerators
in interface IdentifierGeneratorAggregator
generatorMap
- The map of generators.Copyright © 2018 JBoss by Red Hat. All rights reserved.