程序包 org.hibernate.id
类 ForeignGenerator
- java.lang.Object
-
- org.hibernate.id.ForeignGenerator
-
- 所有已实现的接口:
Configurable,IdentifierGenerator
public class ForeignGenerator extends Object implements IdentifierGenerator, Configurable
foreign
An Identifier generator that uses the value of the id property of an associated object
One mapping parameter is required: property.- 作者:
- Gavin King
-
-
字段概要
-
从接口继承的字段 org.hibernate.id.IdentifierGenerator
ENTITY_NAME, GENERATOR_NAME, JPA_ENTITY_NAME
-
-
构造器概要
构造器 构造器 说明 ForeignGenerator()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidconfigure(Type type, Properties params, ServiceRegistry serviceRegistry)Configure this instance, given the value of parameters specified by the user as <param> elements.Serializablegenerate(SharedSessionContractImplementor sessionImplementor, Object object)Generate a new identifier.StringgetEntityName()Getter for property 'entityName'.StringgetPropertyName()Getter for property 'propertyName'.StringgetRole()Getter for property 'role'.-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 org.hibernate.id.IdentifierGenerator
supportsJdbcBatchInserts
-
-
-
-
方法详细资料
-
getEntityName
public String getEntityName()
Getter for property 'entityName'.- 返回:
- Value for property 'entityName'.
-
getPropertyName
public String getPropertyName()
Getter for property 'propertyName'.- 返回:
- Value for property 'propertyName'.
-
getRole
public String getRole()
Getter for property 'role'. Role is theproperty namequalified by theentity name.- 返回:
- Value for property 'role'.
-
configure
public void configure(Type type, Properties params, ServiceRegistry serviceRegistry) throws MappingException
从接口复制的说明:ConfigurableConfigure this instance, given the value of parameters specified by the user as <param> elements. This method is called just once, following instantiation.- 指定者:
configure在接口中Configurable- 参数:
type- The id property type descriptorparams- param values, keyed by parameter nameserviceRegistry- Access to service that may be needed.- 抛出:
MappingException
-
generate
public Serializable generate(SharedSessionContractImplementor sessionImplementor, Object object)
从接口复制的说明:IdentifierGeneratorGenerate a new identifier.- 指定者:
generate在接口中IdentifierGenerator- 参数:
sessionImplementor- The session from which the request originatesobject- the entity or collection (idbag) for which the id is being generated- 返回:
- a new identifier
-
-