code: public static Class getProxyFactory(Class persistentClass, Class[] interfaces) throws PersistenceException
      {
          Enhancer e = new Enhancer();
          e.setSuperclass(interfaces.length == 1 ? persistentClass : null);
          e.setInterfaces(interfaces);
          e.setCallbackTypes(new Class[] { InvocationHandler.class, NoOp.class, });
          e.setCallbackFilter(FINALIZE_FILTER);
          e.setUseFactory(false);
          e.setInterceptDuringConstruction(false);
          return e.createClass();
      }
docs: Gets the proxy factory.
  
  @param persistentClass
  the persistent class
  @param interfaces
  the interfaces
  @return the proxy factory
  @throws PersistenceException
  the persistence exception