Class LazyLoadingProxyFactory

java.lang.Object
cz.cvut.kbss.jopa.proxy.lazy.LazyLoadingProxyFactory

public class LazyLoadingProxyFactory extends Object
Creates lazy-loading proxies for entity attributes.

Needs a UnitOfWork to associate the proxies with, so that lazy loading can be executed when triggered.

  • Constructor Details

    • LazyLoadingProxyFactory

      public LazyLoadingProxyFactory(UnitOfWork uow)
  • Method Details

    • createProxy

      public <T> Object createProxy(T entity, FieldSpecification<? super T,?> fieldSpec)
      Creates a lazy loading proxy for the value of the specified attribute.
      Type Parameters:
      T - Entity type
      Parameters:
      entity - Entity whose attribute will be proxied
      fieldSpec - Attribute to proxy
      Returns:
      Lazy loading proxy associated with a persistence context