org.hibernate.id
Class CompositeNestedGeneratedValueGenerator
java.lang.Object
   org.hibernate.id.CompositeNestedGeneratedValueGenerator
org.hibernate.id.CompositeNestedGeneratedValueGenerator
- 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:
 - 
 "embedded" composite identifier - this is possible only in HBM mappings
 as <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@IdClassusage, though without a separate pk-class for loading.
- 
 pk-class as entity attribute - this is possible in both annotations (@EmbeddedId)
 and HBM mappings (<composite-id name="idAttributeName" class="PkClassName"/>)
- 
 "embedded" composite identifier with a pk-class - this is the JPA @IdClassuse case
 and is only possible in annotations
Most of the grunt work is done inComponent.
- Author:
- Steve Ebersole
- See Also:
- Serialized Form
 
 
 
 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
CompositeNestedGeneratedValueGenerator
public CompositeNestedGeneratedValueGenerator(CompositeNestedGeneratedValueGenerator.GenerationContextLocator generationContextLocator)
addGeneratedValuePlan
public void addGeneratedValuePlan(CompositeNestedGeneratedValueGenerator.GenerationPlan plan)
- 
 
- 
 
generate
public Serializable generate(SessionImplementor session,
                             Object object)
                      throws HibernateException
- Description copied from interface: IdentifierGenerator
- Generate a new identifier.
 
- 
- Specified by:
- generatein interface- IdentifierGenerator
 
- 
- object- the entity or toplevel collection for which the id is being generated
- Returns:
- a new identifier
- Throws:
- HibernateException
 
registerPersistentGenerators
public void registerPersistentGenerators(Map generatorMap)
- Register any sub generators which implement PersistentIdentifierGeneratorby theirgeneratorKey.
 
- 
- Specified by:
- registerPersistentGeneratorsin interface- IdentifierGeneratorAggregator
 
- 
- Parameters:
- generatorMap- The map of generators.
 
Copyright © 2001-2010 Red Hat, Inc.  All Rights Reserved.