KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > proxy > MapProxyFactory


1 //$Id: MapProxyFactory.java,v 1.4 2005/02/12 07:19:45 steveebersole Exp $
2
package org.hibernate.proxy;
3
4 import java.io.Serializable JavaDoc;
5 import java.lang.reflect.Method JavaDoc;
6 import java.util.Set JavaDoc;
7
8 import org.hibernate.HibernateException;
9 import org.hibernate.engine.SessionImplementor;
10 import org.hibernate.type.AbstractComponentType;
11
12 /**
13  * @author Gavin King
14  */

15 public class MapProxyFactory implements ProxyFactory {
16
17     private String JavaDoc entityName;
18
19     public void postInstantiate(
20         final String JavaDoc entityName,
21         final Class JavaDoc persistentClass,
22         final Set JavaDoc interfaces,
23         final Method JavaDoc getIdentifierMethod,
24         final Method JavaDoc setIdentifierMethod,
25         AbstractComponentType componentIdType)
26     throws HibernateException {
27         
28         this.entityName = entityName;
29
30     }
31
32     public HibernateProxy getProxy(
33         final Serializable JavaDoc id,
34         final SessionImplementor session)
35     throws HibernateException {
36         return new MapProxy( new MapLazyInitializer(entityName, id, session) );
37     }
38
39 }
40
Popular Tags