1 | public class CGLIBProxyFactory implements ProxyFactory {↵ | | 1 | public class JavassistProxyFactory implements ProxyFactory, Serializable {↵
|
|
2 | protected static final Class[] NO_CLASSES = new Class[0];↵ | | 2 | protected static final Class[] NO_CLASSES = new Class[0];↵
|
|
3 | private Class persistentClass;↵ | | 3 | private Class persistentClass;↵
|
4 | private String entityName;↵ | | 4 | private String entityName;↵
|
5 | private Class[] interfaces;↵ | | 5 | private Class[] interfaces;↵
|
6 | private Method getIdentifierMethod;↵ | | 6 | private Method getIdentifierMethod;↵
|
7 | private Method setIdentifierMethod;↵ | | 7 | private Method setIdentifierMethod;↵
|
8 | private AbstractComponentType componentIdType;↵ | | 8 | private AbstractComponentType componentIdType;↵
|
9 | private Class factory;↵ | | 9 | private Class factory;↵
|
|
10 | public void postInstantiate(↵ | | 10 | public void postInstantiate(↵
|
11 | final String entityName,↵ | | 11 | final String entityName,↵
|
12 | final Class persistentClass,↵ | | 12 | final Class persistentClass,↵
|
13 | final Set interfaces,↵ | | 13 | final Set interfaces,↵
|
14 | final Method getIdentifierMethod,↵ | | 14 | final Method getIdentifierMethod,↵
|
15 | final Method setIdentifierMethod,↵ | | 15 | final Method setIdentifierMethod,↵
|
16 | AbstractComponentType componentIdType)↵ | | 16 | AbstractComponentType componentIdType)↵
|
17 | throws HibernateException {↵ | | 17 | throws HibernateException {↵
|
18 | this.entityName = entityName;↵ | | 18 | this.entityName = entityName;↵
|
19 | this.persistentClass = persistentClass;↵ | | 19 | this.persistentClass = persistentClass;↵
|
20 | this.interfaces = (Class[]) interfaces.toArray(NO_CLASSES);↵ | | 20 | this.interfaces = (Class[]) interfaces.toArray(NO_CLASSES);↵
|
21 | this.getIdentifierMethod = getIdentifierMethod;↵ | | 21 | this.getIdentifierMethod = getIdentifierMethod;↵
|
22 | this.setIdentifierMethod = setIdentifierMethod;↵ | | 22 | this.setIdentifierMethod = setIdentifierMethod;↵
|
23 | this.componentIdType = componentIdType;↵ | | 23 | this.componentIdType = componentIdType;↵
|
24 | factory = CGLIBLazyInitializer.getProxyFactory(persistentClass, this.interfaces);↵ | | 24 | factory = JavassistLazyInitializer.getProxyFactory( persistentClass, this.interfaces );↵
|
25 | }↵ | | 25 | }↵
|
|
26 | public HibernateProxy getProxy(↵ | | 26 | public HibernateProxy getProxy(↵
|
27 | Serializable id,↵ | | 27 | Serializable id,↵
|
28 | SessionImplementor session)↵ | | 28 | SessionImplementor session)↵
|
29 | throws HibernateException {↵ | | 29 | throws HibernateException {↵
|
|
30 | return CGLIBLazyInitializer.getProxy(↵ | | 30 | return JavassistLazyInitializer.getProxy(↵
|
31 | factory, ↵ | | 31 | factory,↵
|
32 | entityName, ↵ | | 32 | entityName,↵
|
33 | persistentClass, ↵ | | 33 | persistentClass,↵
|
34 | interfaces, ↵ | | 34 | interfaces,↵
|
35 | getIdentifierMethod, ↵ | | 35 | getIdentifierMethod,↵
|
36 | setIdentifierMethod,↵ | | 36 | setIdentifierMethod,↵
|
37 | componentIdType,↵ | | 37 | componentIdType,↵
|
38 | id, ↵ | | 38 | id,↵
|
39 | sessio | | 39 | sessio
|