程序包 org.hibernate.id
类 CompositeNestedGeneratedValueGenerator
- java.lang.Object
-
- org.hibernate.id.CompositeNestedGeneratedValueGenerator
-
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
Component.- 作者:
- Steve Ebersole
- 另请参阅:
- 序列化表格
-
"embedded" composite identifier - this is possible only in HBM mappings
as
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static interfaceCompositeNestedGeneratedValueGenerator.GenerationContextLocatorContract for declaring how to locate the context for sub-value injection.static interfaceCompositeNestedGeneratedValueGenerator.GenerationPlanContract for performing the actual sub-value generation, usually injecting it into the determinedcontext
-
字段概要
-
从接口继承的字段 org.hibernate.id.IdentifierGenerator
ENTITY_NAME, GENERATOR_NAME, JPA_ENTITY_NAME
-
-
构造器概要
构造器 构造器 说明 CompositeNestedGeneratedValueGenerator(CompositeNestedGeneratedValueGenerator.GenerationContextLocator generationContextLocator)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddGeneratedValuePlan(CompositeNestedGeneratedValueGenerator.GenerationPlan plan)Serializablegenerate(SharedSessionContractImplementor session, Object object)Generate a new identifier.voidregisterExportables(Database database)Register the contained exportable things to theDatabase-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 org.hibernate.id.IdentifierGenerator
supportsJdbcBatchInserts
-
-
-
-
构造器详细资料
-
CompositeNestedGeneratedValueGenerator
public CompositeNestedGeneratedValueGenerator(CompositeNestedGeneratedValueGenerator.GenerationContextLocator generationContextLocator)
-
-
方法详细资料
-
addGeneratedValuePlan
public void addGeneratedValuePlan(CompositeNestedGeneratedValueGenerator.GenerationPlan plan)
-
generate
public Serializable generate(SharedSessionContractImplementor session, Object object) throws HibernateException
从接口复制的说明:IdentifierGeneratorGenerate a new identifier.- 指定者:
generate在接口中IdentifierGenerator- 参数:
session- The session from which the request originatesobject- the entity or collection (idbag) for which the id is being generated- 返回:
- a new identifier
- 抛出:
HibernateException- Indicates trouble generating the identifier
-
registerExportables
public void registerExportables(Database database)
从接口复制的说明:ExportableProducerRegister the contained exportable things to theDatabase- 指定者:
registerExportables在接口中ExportableProducer- 参数:
database- The database instance
-
-