KickJava   Java API By Example, From Geeks To Geeks.

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


1 // $Id: Dom4jProxyFactory.java,v 1.2 2005/02/12 07:19:45 steveebersole Exp $
2
package org.hibernate.proxy;
3
4 import org.hibernate.HibernateException;
5 import org.hibernate.type.AbstractComponentType;
6 import org.hibernate.engine.SessionImplementor;
7
8 import java.util.Set JavaDoc;
9 import java.lang.reflect.Method JavaDoc;
10 import java.io.Serializable JavaDoc;
11
12 /**
13  * Builds proxies for "dom4j" entity representations.
14  *
15  * @author Steve Ebersole
16  */

17 public class Dom4jProxyFactory implements ProxyFactory {
18
19     private String JavaDoc entityName;
20
21     /**
22      * Called immediately after instantiation
23      */

24     public void postInstantiate(
25             String JavaDoc entityName,
26             Class JavaDoc persistentClass,
27             Set JavaDoc interfaces,
28             Method JavaDoc getIdentifierMethod,
29             Method JavaDoc setIdentifierMethod,
30             AbstractComponentType componentIdType) throws HibernateException {
31         this.entityName = entityName;
32     }
33
34     /**
35      * Create a new proxy
36      */

37     public HibernateProxy getProxy(Serializable JavaDoc id, SessionImplementor session) throws HibernateException {
38         return new Dom4jProxy( new Dom4jLazyInitializer( entityName, id, session ) );
39     }
40 }
41
Popular Tags