类 PojoEntityTuplizer
- java.lang.Object
-
- org.hibernate.tuple.entity.AbstractEntityTuplizer
-
- org.hibernate.tuple.entity.PojoEntityTuplizer
-
- 所有已实现的接口:
EntityTuplizer,Tuplizer
public class PojoEntityTuplizer extends AbstractEntityTuplizer
AnEntityTuplizerspecific to the pojo entity mode.- 作者:
- Steve Ebersole, Gavin King
-
-
字段概要
-
从类继承的字段 org.hibernate.tuple.entity.AbstractEntityTuplizer
getters, hasCustomAccessors, propertySpan, setters
-
-
构造器概要
构造器 构造器 说明 PojoEntityTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappedEntity)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidafterInitialize(Object entity, SharedSessionContractImplementor session)Called just after the entities properties have been initialized.protected InstantiatorbuildInstantiator(EntityMetamodel entityMetamodel, PersistentClass persistentClass)Build an appropriate Instantiator for the given mapped entity.protected GetterbuildPropertyGetter(Property mappedProperty, PersistentClass mappedEntity)Build an appropriate Getter for the given property.protected SetterbuildPropertySetter(Property mappedProperty, PersistentClass mappedEntity)Build an appropriate Setter for the given property.protected ProxyFactorybuildProxyFactory(PersistentClass persistentClass, Getter idGetter, Setter idSetter)Build an appropriate ProxyFactory for the given mapped entity.protected ProxyFactorybuildProxyFactoryInternal(PersistentClass persistentClass, Getter idGetter, Setter idSetter)StringdetermineConcreteSubclassEntityName(Object entityInstance, SessionFactoryImplementor factory)Given an entity instance, determine the most appropriate (most targeted) entity-name which represents it.ClassgetConcreteProxyClass()Returns the java class to which generated proxies will be typed.EntityModegetEntityMode()Return the entity-mode handled by this tuplizer instance.EntityNameResolver[]getEntityNameResolvers()Get anyEntityNameResolversassociated with thisTuplizer.ClassgetMappedClass()Return the pojo class managed by this tuplizer.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)protected Object[]getPropertyValuesWithOptimizer(Object object)booleanisLifecycleImplementor()voidsetPropertyValues(Object entity, Object[] values)Inject the given values into the given entity.protected voidsetPropertyValuesWithOptimizer(Object object, Object[] values)-
从类继承的方法 org.hibernate.tuple.entity.AbstractEntityTuplizer
createProxy, getComponentValue, getEntityMetamodel, getEntityName, getFactory, getGetter, getIdentifier, getIdentifier, getIdentifierGetter, getIdentifierMapperType, getInstantiator, getPropertyValue, getPropertyValue, getProxyFactory, getSubclassEntityNames, getVersion, getVersionGetter, hasProxy, instantiate, instantiate, instantiate, isInstance, resetIdentifier, resetIdentifier, setIdentifier, setIdentifier, setPropertyValue, setPropertyValue, shouldGetAllProperties, toString
-
-
-
-
构造器详细资料
-
PojoEntityTuplizer
public PojoEntityTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappedEntity)
-
-
方法详细资料
-
buildProxyFactory
protected ProxyFactory buildProxyFactory(PersistentClass persistentClass, Getter idGetter, Setter idSetter)
从类复制的说明:AbstractEntityTuplizerBuild an appropriate ProxyFactory for the given mapped entity.- 指定者:
buildProxyFactory在类中AbstractEntityTuplizer- 参数:
persistentClass- 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.
-
buildProxyFactoryInternal
protected ProxyFactory buildProxyFactoryInternal(PersistentClass persistentClass, Getter idGetter, Setter idSetter)
-
buildInstantiator
protected Instantiator buildInstantiator(EntityMetamodel entityMetamodel, PersistentClass persistentClass)
从类复制的说明:AbstractEntityTuplizerBuild an appropriate Instantiator for the given mapped entity.- 指定者:
buildInstantiator在类中AbstractEntityTuplizerpersistentClass- The mapping information regarding the mapped entity.- 返回:
- An appropriate Instantiator instance.
-
setPropertyValues
public void setPropertyValues(Object entity, Object[] values) throws HibernateException
从接口复制的说明:TuplizerInject the given values into the given entity.- 指定者:
setPropertyValues在接口中Tuplizer- 覆盖:
setPropertyValues在类中AbstractEntityTuplizer- 参数:
entity- The entity.values- The values to be injected.- 抛出:
HibernateException
-
getPropertyValues
public Object[] getPropertyValues(Object entity) throws HibernateException
从接口复制的说明:TuplizerExtract the current values contained on the given entity.- 指定者:
getPropertyValues在接口中Tuplizer- 覆盖:
getPropertyValues在类中AbstractEntityTuplizer- 参数:
entity- The entity from which to extract values.- 返回:
- The current property values.
- 抛出:
HibernateException
-
getPropertyValuesToInsert
public Object[] getPropertyValuesToInsert(Object entity, Map mergeMap, SharedSessionContractImplementor session)
从接口复制的说明:EntityTuplizerExtract the values of the insertable properties of the entity (including backrefs)- 指定者:
getPropertyValuesToInsert在接口中EntityTuplizer- 覆盖:
getPropertyValuesToInsert在类中AbstractEntityTuplizer- 参数:
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.
-
setPropertyValuesWithOptimizer
protected void setPropertyValuesWithOptimizer(Object object, Object[] values)
-
getEntityMode
public EntityMode getEntityMode()
从接口复制的说明:EntityTuplizerReturn the entity-mode handled by this tuplizer instance.- 返回:
- The entity-mode
-
getMappedClass
public Class getMappedClass()
从接口复制的说明:TuplizerReturn the pojo class managed by this tuplizer. Need to determine how to best handle this for the Tuplizers for EntityModes other than POJO. todo : be really nice to not have this here since it is essentially pojo specific...- 返回:
- The persistent class.
-
isLifecycleImplementor
public boolean isLifecycleImplementor()
从接口复制的说明:EntityTuplizer- 指定者:
isLifecycleImplementor在接口中EntityTuplizer- 覆盖:
isLifecycleImplementor在类中AbstractEntityTuplizer- 返回:
- True if the Lifecycle interface is implemented; false otherwise.
-
buildPropertyGetter
protected Getter buildPropertyGetter(Property mappedProperty, PersistentClass mappedEntity)
从类复制的说明:AbstractEntityTuplizerBuild an appropriate Getter for the given property.- 指定者:
buildPropertyGetter在类中AbstractEntityTuplizer- 参数:
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 Setter buildPropertySetter(Property mappedProperty, PersistentClass mappedEntity)
从类复制的说明:AbstractEntityTuplizerBuild an appropriate Setter for the given property.- 指定者:
buildPropertySetter在类中AbstractEntityTuplizer- 参数:
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.
-
getConcreteProxyClass
public Class getConcreteProxyClass()
从接口复制的说明:EntityTuplizerReturns the java class to which generated proxies will be typed. todo : look at fully encapsulatingPersistenceContext.narrowProxy(java.lang.Object, org.hibernate.persister.entity.EntityPersister, org.hibernate.engine.spi.EntityKey, java.lang.Object)here, since that is the only external use of this method- 返回:
- The java class to which generated proxies will be typed
-
afterInitialize
public void afterInitialize(Object entity, SharedSessionContractImplementor session)
从接口复制的说明:EntityTuplizerCalled just after the entities properties have been initialized.- 指定者:
afterInitialize在接口中EntityTuplizer- 覆盖:
afterInitialize在类中AbstractEntityTuplizer- 参数:
entity- The entity being initialized.session- The session initializing this entity.
-
determineConcreteSubclassEntityName
public String determineConcreteSubclassEntityName(Object entityInstance, SessionFactoryImplementor factory)
从接口复制的说明:EntityTuplizerGiven an entity instance, determine the most appropriate (most targeted) entity-name which represents it. This is called in situations where we already know an entity name for the given entityInstance; we are being asked to determine if there is a more appropriate entity-name to use, specifically within an inheritance hierarchy. For example, consider a case where a user calls session.update( "Animal", cat );. Here, the user has explicitly provided Animal as the entity-name. However, they have passed in an instance of Cat which is a subclass of Animal. In this case, we would return Cat as the entity-name. null may be returned from calls to this method. The meaning of null in that case is assumed to be that we should use whatever explicit entity-name the user provided (Animal rather than Cat in the example above).- 参数:
entityInstance- The entity instance.factory- Reference to the SessionFactory.- 返回:
- The most appropriate entity name to use.
-
getEntityNameResolvers
public EntityNameResolver[] getEntityNameResolvers()
从接口复制的说明:EntityTuplizerGet anyEntityNameResolversassociated with thisTuplizer.- 返回:
- The associated resolvers. May be null or empty.
-
-