Package io.jmix.core

Class FluentValueLoader<T>

java.lang.Object
io.jmix.core.FluentValueLoader<T>

@Component("core_FluentValueLoader") @Scope("prototype") public class FluentValueLoader<T> extends Object
  • Field Details

  • Constructor Details

    • FluentValueLoader

      public FluentValueLoader(String queryString, Class<T> valueClass)
  • Method Details

    • createLoadContext

      protected ValueLoadContext createLoadContext()
    • list

      public List<T> list()
      Loads a list of entities.
    • optional

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

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

      public FluentValueLoader<T> store(String store)
      Sets DataStore name.
    • hint

      public FluentValueLoader<T> hint(String hintName, Serializable value)
      Sets custom hint that should be used by the query.
    • hints

      public FluentValueLoader<T> hints(Map<String,Serializable> hints)
      Sets custom hints that should be used by the query.
    • parameter

      public FluentValueLoader<T> parameter(String name, Object value)
      Sets value for a query parameter.
      Parameters:
      name - parameter name
      value - parameter value
    • parameter

      public FluentValueLoader<T> parameter(String name, Date value, jakarta.persistence.TemporalType temporalType)
      Sets value for a parameter of java.util.Date type.
      Parameters:
      name - parameter name
      value - parameter value
      temporalType - how to interpret the value
    • parameter

      public FluentValueLoader<T> parameter(String name, Object value, boolean implicitConversion)
      Sets value for a query parameter.
      Parameters:
      name - parameter name
      value - parameter value
      implicitConversion - whether to do parameter value conversions, e.g. convert an entity to its ID
    • setParameters

      public FluentValueLoader<T> setParameters(Map<String,Object> parameters)
      Sets the map of query parameters.
    • firstResult

      public FluentValueLoader<T> firstResult(int firstResult)
      Sets results offset.
    • maxResults

      public FluentValueLoader<T> maxResults(int maxResults)
      Sets results limit.
    • lockMode

      public FluentValueLoader<T> lockMode(jakarta.persistence.LockModeType lockMode)
      Sets a lock mode to be used when executing query.
    • setDataManager

      public void setDataManager(UnconstrainedDataManager dataManager)
    • joinTransaction

      public io.jmix.core.AbstractFluentValueLoader joinTransaction(boolean join)
    • accessConstraints

      public io.jmix.core.AbstractFluentValueLoader accessConstraints(List<AccessConstraint<?>> accessConstraints)
      Sets access constraints.
    • instantiateValueLoadContext

      protected ValueLoadContext instantiateValueLoadContext()