Interface LazyLoadingDelegate

All Known Implementing Classes:
HibernateLazyLoadingDelegate

public interface LazyLoadingDelegate
The LazyLoadingDelegate is called when a property that is lazily loaded is being accessed through the Vaadin data API. The LazyLoadingDelegate is responsible for ensuring that the lazily loaded property is loaded and accessible.
Since:
2.0
  • Method Summary

    Modifier and Type
    Method
    Description
    <E> E
    ensureLazyPropertyLoaded(E entity, String propertyName)
    This method is called when a lazily loaded property is accessed in an entity.
    void
    Sets the EntityProvider that this delegate is associated with.
  • Method Details

    • ensureLazyPropertyLoaded

      <E> E ensureLazyPropertyLoaded(E entity, String propertyName)
      This method is called when a lazily loaded property is accessed in an entity. The implementation of this method is responsible for ensuring that the property in question is accessible on the instance of entity that is returned.
      Parameters:
      entity - The entity containing a lazy property.
      propertyName - The name of the lazy property to be accessed.
      Returns:
      an instance of entity with propertyName attached and accessible. This may be the same instance as passed in or a new one.
    • setEntityProvider

      void setEntityProvider(EntityProvider<?> ep)
      Sets the EntityProvider that this delegate is associated with. Automatically called by EntityProvider.setLazyLoadingDelegate(LazyLoadingDelegate). The EntityProvider is used to get the current EntityManager.
      Parameters:
      ep -