Package io.jmix.core

Class FetchPlan

java.lang.Object
io.jmix.core.FetchPlan
All Implemented Interfaces:
Serializable

public class FetchPlan extends Object implements Serializable
Class to declare a graph of objects that must be retrieved from the database.

A fetchPlan can be constructed in Java code or defined in XML and deployed to the FetchPlanRepository for recurring usage.

There are the following predefined fetchPlan types:
See Also:
  • Field Details

  • Constructor Details

    • FetchPlan

      protected FetchPlan(Class<?> entityClass, String name)
  • Method Details

    • getEntityClass

      public Class<?> getEntityClass()
      Returns:
      entity class this fetchPlan belongs to
    • getName

      public String getName()
      Returns:
      fetchPlan name, unique within an entity
    • getProperties

      public Collection<FetchPlanProperty> getProperties()
      Returns:
      collection of properties
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • isSupersetOf

      public boolean isSupersetOf(FetchPlan fetchPlan)
      Returns:
      whether this fetch plan contains all attributes of fetchPlan including nested plans attributes
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getProperty

      @Nullable public FetchPlanProperty getProperty(String name)
      Get directly owned fetchPlan property by name.
      Parameters:
      name - property name
      Returns:
      fetchPlan property instance or null if it is not found
    • containsProperty

      public boolean containsProperty(String name)
      Check if a directly owned property with the given name exists in the fetchPlan.
      Parameters:
      name - property name
      Returns:
      true if such property found
    • loadPartialEntities

      public boolean loadPartialEntities()
      If true, the fetchPlan affects loading of local attributes. If false, only reference attributes are affected and local are always loaded.