Class JavassistProxyFactory
- java.lang.Object
-
- org.hibernate.proxy.pojo.javassist.JavassistProxyFactory
-
- All Implemented Interfaces:
Serializable,ProxyFactory
public class JavassistProxyFactory extends Object implements ProxyFactory, Serializable
AProxyFactoryimplementation for producing Javassist-based proxies.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JavassistProxyFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static javassist.util.proxy.ProxyFactorybuildJavassistProxyFactory(Class persistentClass, Class[] interfaces)static HibernateProxydeserializeProxy(SerializableProxy serializableProxy)HibernateProxygetProxy(Serializable id, SharedSessionContractImplementor session)Create a new proxy instancevoidpostInstantiate(String entityName, Class persistentClass, Set<Class> interfaces, Method getIdentifierMethod, Method setIdentifierMethod, CompositeType componentIdType)Called immediately after instantiation of this factory.
-
-
-
Method Detail
-
postInstantiate
public void postInstantiate(String entityName, Class persistentClass, Set<Class> interfaces, Method getIdentifierMethod, Method setIdentifierMethod, CompositeType componentIdType) throws HibernateException
Description copied from interface:ProxyFactoryCalled immediately after instantiation of this factory. Essentially equivalent to constructor injection, but contracted here via interface.- Specified by:
postInstantiatein interfaceProxyFactory- Parameters:
entityName- The name of the entity for which this factory should generate proxies.persistentClass- The entity class for which to generate proxies; not always the same as the entityName.interfaces- The interfaces to expose in the generated proxy;HibernateProxyis already included in this collection.getIdentifierMethod- Reference to the identifier getter method; invocation on this method should not force initializationsetIdentifierMethod- Reference to the identifier setter method; invocation on this method should not force initializationcomponentIdType- For composite identifier types, a reference to thetypeof the identifier property; again accessing the id should generally not cause initialization - but need to bear in mindmappings. - Throws:
HibernateException- Indicates a problem completing post instantiation initialization.
-
buildJavassistProxyFactory
public static javassist.util.proxy.ProxyFactory buildJavassistProxyFactory(Class persistentClass, Class[] interfaces)
-
getProxy
public HibernateProxy getProxy(Serializable id, SharedSessionContractImplementor session) throws HibernateException
Description copied from interface:ProxyFactoryCreate a new proxy instance- Specified by:
getProxyin interfaceProxyFactory- Parameters:
id- The id value for the proxy to be generated.session- The session to which the generated proxy will be associated.- Returns:
- The generated proxy.
- Throws:
HibernateException- Indicates problems generating the requested proxy.
-
deserializeProxy
public static HibernateProxy deserializeProxy(SerializableProxy serializableProxy)
-
-