Package io.jmix.core

Class FluentLoader.ById<E>

java.lang.Object
io.jmix.core.FluentLoader.ById<E>
Enclosing class:
FluentLoader<E>

public static class FluentLoader.ById<E> extends Object
  • Constructor Details

  • Method Details

    • optional

      public Optional<E> optional()
      Loads a single instance and wraps it in Optional.
    • one

      public E one()
      Loads a single instance.
      Throws:
      IllegalStateException - if nothing was loaded
    • fetchPlan

      public FluentLoader.ById<E> fetchPlan(@Nullable FetchPlan fetchPlan)
      Sets a fetch plan.
    • fetchPlan

      public FluentLoader.ById<E> fetchPlan(@Nullable String fetchPlanName)
      Sets a fetch plan by name.
    • fetchPlan

      public FluentLoader.ById<E> fetchPlan(Consumer<FetchPlanBuilder> fetchPlanBuilderConfigurer)
      Configure the fetch plan.
    • fetchPlanProperties

      public FluentLoader.ById<E> fetchPlanProperties(String... properties)
      Sets a fetch plan containing the given properties. A property can be designated by a path in the entity graph. For example:
           dataManager.load(Pet.class)
               .id(petId)
               .fetchPlanProperties(
                       "name",
                       "owner.name",
                       "owner.address.city")
               .list();
       
    • hint

      public FluentLoader.ById<E> hint(String hintName, Serializable value)
      Adds a custom hint that should be used by the query.
    • hints

      public FluentLoader.ById<E> hints(Map<String,Serializable> hints)
      Adds custom hints that should be used by the query.
    • accessConstraints

      public FluentLoader.ById<E> accessConstraints(Collection<AccessConstraint<?>> accessConstraints)
      Adds access constraints.
    • accessConstraints

      public FluentLoader.ById<E> accessConstraints(Class<? extends AccessConstraint> accessConstraintsClass)
      Adds registered access constraints that are subclasses of the given class.
    • joinTransaction

      public FluentLoader.ById<E> joinTransaction(boolean join)
      Indicates that the operation must be performed in an existing transaction if it exists. True by default.
    • lockMode

      public FluentLoader.ById<E> lockMode(jakarta.persistence.LockModeType lockMode)
      Sets a lock mode to be used when executing query.