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 TypeMethodDescription<E> EensureLazyPropertyLoaded(E entity, String propertyName) This method is called when a lazily loaded property is accessed in an entity.voidsetEntityProvider(EntityProvider<?> ep) Sets the EntityProvider that this delegate is associated with.
-
Method Details
-
ensureLazyPropertyLoaded
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 ofentitythat is returned.- Parameters:
entity- The entity containing a lazy property.propertyName- The name of the lazy property to be accessed.- Returns:
- an instance of
entitywithpropertyNameattached and accessible. This may be the same instance as passed in or a new one.
-
setEntityProvider
Sets the EntityProvider that this delegate is associated with. Automatically called byEntityProvider.setLazyLoadingDelegate(LazyLoadingDelegate). The EntityProvider is used to get the currentEntityManager.- Parameters:
ep-
-