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 |
registerExportables(Database database)
Register the contained exportable things to the
Database |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
supportsJdbcBatchInserts
public CompositeNestedGeneratedValueGenerator(CompositeNestedGeneratedValueGenerator.GenerationContextLocator generationContextLocator)
public void addGeneratedValuePlan(CompositeNestedGeneratedValueGenerator.GenerationPlan plan)
public Serializable generate(SharedSessionContractImplementor session, Object object) throws HibernateException
IdentifierGenerator
generate
in interface IdentifierGenerator
session
- 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)
ExportableProducer
Database
registerExportables
in interface ExportableProducer
database
- The database instanceCopyright © 2021 JBoss by Red Hat. All rights reserved.