org.hibernate.test.dynamicentity.tuplizer2
Class MyEntityTuplizer
java.lang.Object
org.hibernate.tuple.entity.AbstractEntityTuplizer
org.hibernate.tuple.entity.PojoEntityTuplizer
org.hibernate.test.dynamicentity.tuplizer2.MyEntityTuplizer
- All Implemented Interfaces:
- EntityTuplizer, Tuplizer
public class MyEntityTuplizer
- extends PojoEntityTuplizer
Methods inherited from class org.hibernate.tuple.entity.PojoEntityTuplizer |
afterInitialize, buildInstantiator, buildPropertyGetter, buildPropertyGetter, buildPropertySetter, buildPropertySetter, buildProxyFactory, buildProxyFactoryInternal, buildProxyFactoryInternal, getConcreteProxyClass, getEntityMode, getMappedClass, getPropertyValues, getPropertyValuesToInsert, getPropertyValuesWithOptimizer, hasUninitializedLazyProperties, isInstrumented, isLifecycleImplementor, setPropertyValues, setPropertyValuesWithOptimizer |
Methods inherited from class 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 |
MyEntityTuplizer
public MyEntityTuplizer(EntityMetamodel entityMetamodel,
PersistentClass mappedEntity)
MyEntityTuplizer
public MyEntityTuplizer(EntityMetamodel entityMetamodel,
EntityBinding mappedEntity)
getEntityNameResolvers
public EntityNameResolver[] getEntityNameResolvers()
- Description copied from class:
PojoEntityTuplizer
- Get any
EntityNameResolvers
associated with this Tuplizer
.
- Specified by:
getEntityNameResolvers
in interface EntityTuplizer
- Overrides:
getEntityNameResolvers
in class PojoEntityTuplizer
- Returns:
- The associated resolvers. May be null or empty.
buildInstantiator
protected Instantiator buildInstantiator(PersistentClass persistentClass)
- Description copied from class:
PojoEntityTuplizer
- Build an appropriate Instantiator for the given mapped entity.
- Overrides:
buildInstantiator
in class PojoEntityTuplizer
- Parameters:
persistentClass
- The mapping information regarding the mapped entity.
- Returns:
- An appropriate Instantiator instance.
determineConcreteSubclassEntityName
public String determineConcreteSubclassEntityName(Object entityInstance,
SessionFactoryImplementor factory)
- Description copied from class:
PojoEntityTuplizer
- Given 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 inheritence
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 meaining 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).
- Specified by:
determineConcreteSubclassEntityName
in interface EntityTuplizer
- Overrides:
determineConcreteSubclassEntityName
in class PojoEntityTuplizer
- Parameters:
entityInstance
- The entity instance.factory
- Reference to the SessionFactory.
- Returns:
- The most appropriate entity name to use.
buildProxyFactory
protected ProxyFactory buildProxyFactory(PersistentClass persistentClass,
Getter idGetter,
Setter idSetter)
- Description copied from class:
PojoEntityTuplizer
- Build an appropriate ProxyFactory for the given mapped entity.
- Overrides:
buildProxyFactory
in class PojoEntityTuplizer
- Parameters:
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.
- Returns:
- An appropriate ProxyFactory instance.
Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.