Class CompositeNestedGeneratedValueGenerator

  extended by
All Implemented Interfaces:
Serializable, IdentifierGenerator, IdentifierGeneratorAggregator

public class CompositeNestedGeneratedValueGenerator
extends Object
implements IdentifierGenerator, Serializable, IdentifierGeneratorAggregator

For composite identifiers, defines a number of "nested" generations that need to happen to "fill" the identifier property(s).

This generator is used implicitly for all composite identifier scenarios if an explicit generator is not in place. So it make sense to discuss the various potential scenarios:

Most of the grunt work is done in Component.

Steve Ebersole
See Also:
Serialized Form

Nested Class Summary
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
Field Summary
Fields inherited from interface
Constructor Summary
CompositeNestedGeneratedValueGenerator(CompositeNestedGeneratedValueGenerator.GenerationContextLocator generationContextLocator)
Method Summary
 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.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public CompositeNestedGeneratedValueGenerator(CompositeNestedGeneratedValueGenerator.GenerationContextLocator generationContextLocator)
Method Detail


public void addGeneratedValuePlan(CompositeNestedGeneratedValueGenerator.GenerationPlan plan)


public Serializable generate(SessionImplementor session,
                             Object object)
                      throws HibernateException
Description copied from interface: IdentifierGenerator
Generate a new identifier.

Specified by:
generate in interface IdentifierGenerator
object - the entity or toplevel collection for which the id is being generated
a new identifier


public void registerPersistentGenerators(Map generatorMap)
Register any sub generators which implement PersistentIdentifierGenerator by their generatorKey.

Specified by:
registerPersistentGenerators in interface IdentifierGeneratorAggregator
generatorMap - The map of generators.

Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.