类 AbstractEntityTuplizer
- java.lang.Object
-
- org.hibernate.tuple.entity.AbstractEntityTuplizer
-
- 所有已实现的接口:
EntityTuplizer,Tuplizer
public abstract class AbstractEntityTuplizer extends Object implements EntityTuplizer
Support for tuplizers relating to entities.- 作者:
- Steve Ebersole, Gavin King
-
-
字段概要
字段 修饰符和类型 字段 说明 protected Getter[]gettersprotected booleanhasCustomAccessorsprotected intpropertySpanprotected Setter[]setters
-
构造器概要
构造器 构造器 说明 AbstractEntityTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappingInfo)Constructs a new AbstractEntityTuplizer instance.
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 voidafterInitialize(Object entity, SharedSessionContractImplementor session)Called just after the entities properties have been initialized.protected abstract InstantiatorbuildInstantiator(EntityMetamodel entityMetamodel, PersistentClass mappingInfo)Build an appropriate Instantiator for the given mapped entity.protected abstract GetterbuildPropertyGetter(Property mappedProperty, PersistentClass mappedEntity)Build an appropriate Getter for the given property.protected abstract SetterbuildPropertySetter(Property mappedProperty, PersistentClass mappedEntity)Build an appropriate Setter for the given property.protected abstract ProxyFactorybuildProxyFactory(PersistentClass mappingInfo, Getter idGetter, Setter idSetter)Build an appropriate ProxyFactory for the given mapped entity.ObjectcreateProxy(Serializable id, SharedSessionContractImplementor session)Generates an appropriate proxy representation of this entity for this entity-mode.protected ObjectgetComponentValue(ComponentType type, Object component, String propertyPath)Extract a component property value.protected EntityMetamodelgetEntityMetamodel()protected StringgetEntityName()Retrieves the defined entity-name for the tuplized entity.protected SessionFactoryImplementorgetFactory()GettergetGetter(int i)Retrieve the getter for the specified property.SerializablegetIdentifier(Object entity)Extract the identifier value from the given entity.SerializablegetIdentifier(Object entity, SharedSessionContractImplementor session)Extract the identifier value from the given entity.GettergetIdentifierGetter()Retrieve the getter for the identifier property.TypegetIdentifierMapperType()protected InstantiatorgetInstantiator()ObjectgetPropertyValue(Object entity, int i)Extract the value of a particular property from the given entity.ObjectgetPropertyValue(Object entity, String propertyPath)Extract the value of a particular property from the given entity.Object[]getPropertyValues(Object entity)Extract the current values contained on the given entity.Object[]getPropertyValuesToInsert(Object entity, Map mergeMap, SharedSessionContractImplementor session)Extract the values of the insertable properties of the entity (including backrefs)ProxyFactorygetProxyFactory()protected SetgetSubclassEntityNames()Retrieves the defined entity-names for any subclasses defined for this entity.ObjectgetVersion(Object entity)Extract the value of the version property from the given entity.GettergetVersionGetter()Retrieve the getter for the version property.booleanhasProxy()Does this entity, for this mode, present a possibility for proxying?Objectinstantiate()Generate a new, empty entity.Objectinstantiate(Serializable id)Create an entity instance initialized with the given identifier.Objectinstantiate(Serializable id, SharedSessionContractImplementor session)Create an entity instance initialized with the given identifier.booleanisInstance(Object object)Is the given object considered an instance of the the entity (accounting for entity-mode) managed by this tuplizer.booleanisLifecycleImplementor()voidresetIdentifier(Object entity, Serializable currentId, Object currentVersion)Inject the given identifier and version into the entity, in order to "roll back" to their original values.voidresetIdentifier(Object entity, Serializable currentId, Object currentVersion, SharedSessionContractImplementor session)Inject the given identifier and version into the entity, in order to "roll back" to their original values.voidsetIdentifier(Object entity, Serializable id)Inject the identifier value into the given entity.voidsetIdentifier(Object entity, Serializable id, SharedSessionContractImplementor session)Inject the identifier value into the given entity.voidsetPropertyValue(Object entity, int i, Object value)Inject the value of a particular property.voidsetPropertyValue(Object entity, String propertyName, Object value)Inject the value of a particular property.voidsetPropertyValues(Object entity, Object[] values)Inject the given values into the given entity.protected booleanshouldGetAllProperties(Object entity)StringtoString()-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
从接口继承的方法 org.hibernate.tuple.entity.EntityTuplizer
determineConcreteSubclassEntityName, getConcreteProxyClass, getEntityMode, getEntityNameResolvers
-
从接口继承的方法 org.hibernate.tuple.Tuplizer
getMappedClass
-
-
-
-
构造器详细资料
-
AbstractEntityTuplizer
public AbstractEntityTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappingInfo)
Constructs a new AbstractEntityTuplizer instance.- 参数:
entityMetamodel- The "interpreted" information relating to the mapped entity.mappingInfo- The parsed "raw" mapping data relating to the given entity.
-
-
方法详细资料
-
getIdentifierMapperType
public Type getIdentifierMapperType()
-
buildPropertyGetter
protected abstract Getter buildPropertyGetter(Property mappedProperty, PersistentClass mappedEntity)
Build an appropriate Getter for the given property.- 参数:
mappedProperty- The property to be accessed via the built Getter.mappedEntity- The entity information regarding the mapped entity owning this property.- 返回:
- An appropriate Getter instance.
-
buildPropertySetter
protected abstract Setter buildPropertySetter(Property mappedProperty, PersistentClass mappedEntity)
Build an appropriate Setter for the given property.- 参数:
mappedProperty- The property to be accessed via the built Setter.mappedEntity- The entity information regarding the mapped entity owning this property.- 返回:
- An appropriate Setter instance.
-
buildInstantiator
protected abstract Instantiator buildInstantiator(EntityMetamodel entityMetamodel, PersistentClass mappingInfo)
Build an appropriate Instantiator for the given mapped entity.- 参数:
mappingInfo- The mapping information regarding the mapped entity.- 返回:
- An appropriate Instantiator instance.
-
buildProxyFactory
protected abstract ProxyFactory buildProxyFactory(PersistentClass mappingInfo, Getter idGetter, Setter idSetter)
Build an appropriate ProxyFactory for the given mapped entity.- 参数:
mappingInfo- The mapping information regarding the mapped entity.idGetter- The constructed Getter relating to the entity's id property.idSetter- The constructed Setter relating to the entity's id property.- 返回:
- An appropriate ProxyFactory instance.
-
getEntityName
protected String getEntityName()
Retrieves the defined entity-name for the tuplized entity.- 返回:
- The entity-name.
-
getSubclassEntityNames
protected Set getSubclassEntityNames()
Retrieves the defined entity-names for any subclasses defined for this entity.- 返回:
- Any subclass entity-names.
-
getIdentifier
public Serializable getIdentifier(Object entity) throws HibernateException
从接口复制的说明:EntityTuplizerExtract the identifier value from the given entity.- 指定者:
getIdentifier在接口中EntityTuplizer- 参数:
entity- The entity from which to extract the identifier value.- 返回:
- The identifier value.
- 抛出:
HibernateException- If the entity does not define an identifier property, or an error occurs accessing its value.
-
getIdentifier
public Serializable getIdentifier(Object entity, SharedSessionContractImplementor session)
从接口复制的说明:EntityTuplizerExtract the identifier value from the given entity.- 指定者:
getIdentifier在接口中EntityTuplizer- 参数:
entity- The entity from which to extract the identifier value.session- The session from which is requests originates- 返回:
- The identifier value.
-
setIdentifier
public void setIdentifier(Object entity, Serializable id) throws HibernateException
从接口复制的说明:EntityTuplizerInject the identifier value into the given entity. Has no effect if the entity does not define an identifier property- 指定者:
setIdentifier在接口中EntityTuplizer- 参数:
entity- The entity to inject with the identifier value.id- The value to be injected as the identifier.- 抛出:
HibernateException
-
setIdentifier
public void setIdentifier(Object entity, Serializable id, SharedSessionContractImplementor session)
从接口复制的说明:EntityTuplizerInject the identifier value into the given entity. Has no effect if the entity does not define an identifier property- 指定者:
setIdentifier在接口中EntityTuplizer- 参数:
entity- The entity to inject with the identifier value.id- The value to be injected as the identifier.session- The session from which is requests originates
-
resetIdentifier
public void resetIdentifier(Object entity, Serializable currentId, Object currentVersion)
从接口复制的说明:EntityTuplizerInject the given identifier and version into the entity, in order to "roll back" to their original values.- 指定者:
resetIdentifier在接口中EntityTuplizer- 参数:
entity- The entity for which to reset the id/version valuescurrentId- The identifier value to inject into the entity.currentVersion- The version value to inject into the entity.
-
resetIdentifier
public void resetIdentifier(Object entity, Serializable currentId, Object currentVersion, SharedSessionContractImplementor session)
从接口复制的说明:EntityTuplizerInject the given identifier and version into the entity, in order to "roll back" to their original values.- 指定者:
resetIdentifier在接口中EntityTuplizer- 参数:
entity- The entity for which to reset the id/version valuescurrentId- The identifier value to inject into the entity.currentVersion- The version value to inject into the entity.session- The session from which the request originated
-
getVersion
public Object getVersion(Object entity) throws HibernateException
从接口复制的说明:EntityTuplizerExtract the value of the version property from the given entity.- 指定者:
getVersion在接口中EntityTuplizer- 参数:
entity- The entity from which to extract the version value.- 返回:
- The value of the version property, or null if not versioned.
- 抛出:
HibernateException- Indicates a problem accessing the version property
-
shouldGetAllProperties
protected boolean shouldGetAllProperties(Object entity)
-
getPropertyValues
public Object[] getPropertyValues(Object entity)
从接口复制的说明:TuplizerExtract the current values contained on the given entity.- 指定者:
getPropertyValues在接口中Tuplizer- 参数:
entity- The entity from which to extract values.- 返回:
- The current property values.
-
getPropertyValuesToInsert
public Object[] getPropertyValuesToInsert(Object entity, Map mergeMap, SharedSessionContractImplementor session)
从接口复制的说明:EntityTuplizerExtract the values of the insertable properties of the entity (including backrefs)- 指定者:
getPropertyValuesToInsert在接口中EntityTuplizer- 参数:
entity- The entity from which to extract.mergeMap- a map of instances being merged to merged instancessession- The session in which the result set is being made.- 返回:
- The insertable property values.
-
getPropertyValue
public Object getPropertyValue(Object entity, int i) throws HibernateException
从接口复制的说明:TuplizerExtract the value of a particular property from the given entity.- 指定者:
getPropertyValue在接口中Tuplizer- 参数:
entity- The entity from which to extract the property value.i- The index of the property for which to extract the value.- 返回:
- The current value of the given property on the given entity.
- 抛出:
HibernateException
-
getPropertyValue
public Object getPropertyValue(Object entity, String propertyPath) throws HibernateException
从接口复制的说明:EntityTuplizerExtract the value of a particular property from the given entity.- 指定者:
getPropertyValue在接口中EntityTuplizer- 参数:
entity- The entity from which to extract the property value.propertyPath- The name of the property for which to extract the value.- 返回:
- The current value of the given property on the given entity.
- 抛出:
HibernateException- Indicates a problem access the property
-
getComponentValue
protected Object getComponentValue(ComponentType type, Object component, String propertyPath)
Extract a component property value.- 参数:
type- The component property types.component- The component instance itself.propertyPath- The property path for the property to be extracted.- 返回:
- The property value extracted.
-
setPropertyValues
public void setPropertyValues(Object entity, Object[] values) throws HibernateException
从接口复制的说明:TuplizerInject the given values into the given entity.- 指定者:
setPropertyValues在接口中Tuplizer- 参数:
entity- The entity.values- The values to be injected.- 抛出:
HibernateException
-
setPropertyValue
public void setPropertyValue(Object entity, int i, Object value) throws HibernateException
从接口复制的说明:EntityTuplizerInject the value of a particular property.- 指定者:
setPropertyValue在接口中EntityTuplizer- 参数:
entity- The entity into which to inject the value.i- The property's index.value- The property value to inject.- 抛出:
HibernateException- Indicates a problem access the property
-
setPropertyValue
public void setPropertyValue(Object entity, String propertyName, Object value) throws HibernateException
从接口复制的说明:EntityTuplizerInject the value of a particular property.- 指定者:
setPropertyValue在接口中EntityTuplizer- 参数:
entity- The entity into which to inject the value.propertyName- The name of the property.value- The property value to inject.- 抛出:
HibernateException- Indicates a problem access the property
-
instantiate
public final Object instantiate(Serializable id) throws HibernateException
从接口复制的说明:EntityTuplizerCreate an entity instance initialized with the given identifier.- 指定者:
instantiate在接口中EntityTuplizer- 参数:
id- The identifier value for the entity to be instantiated.- 返回:
- The instantiated entity.
- 抛出:
HibernateException
-
instantiate
public final Object instantiate(Serializable id, SharedSessionContractImplementor session)
从接口复制的说明:EntityTuplizerCreate an entity instance initialized with the given identifier.- 指定者:
instantiate在接口中EntityTuplizer- 参数:
id- The identifier value for the entity to be instantiated.session- The session from which is requests originates- 返回:
- The instantiated entity.
-
instantiate
public final Object instantiate() throws HibernateException
从接口复制的说明:TuplizerGenerate a new, empty entity.- 指定者:
instantiate在接口中Tuplizer- 返回:
- The new, empty entity instance.
- 抛出:
HibernateException
-
afterInitialize
public void afterInitialize(Object entity, SharedSessionContractImplementor session)
从接口复制的说明:EntityTuplizerCalled just after the entities properties have been initialized.- 指定者:
afterInitialize在接口中EntityTuplizer- 参数:
entity- The entity being initialized.session- The session initializing this entity.
-
isInstance
public final boolean isInstance(Object object)
从接口复制的说明:TuplizerIs the given object considered an instance of the the entity (accounting for entity-mode) managed by this tuplizer.- 指定者:
isInstance在接口中Tuplizer- 参数:
object- The object to be checked.- 返回:
- True if the object is considered as an instance of this entity within the given mode.
-
hasProxy
public boolean hasProxy()
从接口复制的说明:EntityTuplizerDoes this entity, for this mode, present a possibility for proxying?- 指定者:
hasProxy在接口中EntityTuplizer- 返回:
- True if this tuplizer can generate proxies for this entity.
-
createProxy
public final Object createProxy(Serializable id, SharedSessionContractImplementor session)
从接口复制的说明:EntityTuplizerGenerates an appropriate proxy representation of this entity for this entity-mode.- 指定者:
createProxy在接口中EntityTuplizer- 参数:
id- The id of the instance for which to generate a proxy.session- The session to which the proxy should be bound.- 返回:
- The generate proxies.
-
isLifecycleImplementor
public boolean isLifecycleImplementor()
从接口复制的说明:EntityTuplizer- 指定者:
isLifecycleImplementor在接口中EntityTuplizer- 返回:
- True if the Lifecycle interface is implemented; false otherwise.
-
getEntityMetamodel
protected final EntityMetamodel getEntityMetamodel()
-
getFactory
protected final SessionFactoryImplementor getFactory()
-
getInstantiator
protected final Instantiator getInstantiator()
-
getProxyFactory
public final ProxyFactory getProxyFactory()
- 指定者:
getProxyFactory在接口中EntityTuplizer
-
getIdentifierGetter
public Getter getIdentifierGetter()
从接口复制的说明:EntityTuplizerRetrieve the getter for the identifier property. May return null.- 指定者:
getIdentifierGetter在接口中EntityTuplizer- 返回:
- The getter for the identifier property.
-
getVersionGetter
public Getter getVersionGetter()
从接口复制的说明:EntityTuplizerRetrieve the getter for the version property. May return null.- 指定者:
getVersionGetter在接口中EntityTuplizer- 返回:
- The getter for the version property.
-
-