1 package org.hibernate.proxy; 3 4 import java.io.Serializable ; 5 import java.lang.reflect.Method ; 6 import java.util.Set ; 7 8 import org.hibernate.HibernateException; 9 import org.hibernate.engine.SessionImplementor; 10 import org.hibernate.type.AbstractComponentType; 11 12 15 public class MapProxyFactory implements ProxyFactory { 16 17 private String entityName; 18 19 public void postInstantiate( 20 final String entityName, 21 final Class persistentClass, 22 final Set interfaces, 23 final Method getIdentifierMethod, 24 final Method setIdentifierMethod, 25 AbstractComponentType componentIdType) 26 throws HibernateException { 27 28 this.entityName = entityName; 29 30 } 31 32 public HibernateProxy getProxy( 33 final Serializable id, 34 final SessionImplementor session) 35 throws HibernateException { 36 return new MapProxy( new MapLazyInitializer(entityName, id, session) ); 37 } 38 39 } 40 | Popular Tags |