Package io.jmix.core
Class ValueLoadContext
java.lang.Object
io.jmix.core.ValueLoadContext
- All Implemented Interfaces:
- DataLoadContext,- Serializable
Class that defines parameters for loading values from the database via 
UnconstrainedDataManager.loadValues(ValueLoadContext).
 Typical usage:
 ValueLoadContext context = ValueLoadContext.create()
      .setQuery(ValueLoadContext.createQuery("select e.id, e.name from sample$Customer e where e.grade = :grade")
          .setParameter("grade", 1))
      .addProperty("id")
      .addProperty("name");
 - See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classClass that defines a query to be executed for loading values.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected List<AccessConstraint<?>>protected Map<String,Serializable> protected Stringprotected booleanprotected jakarta.persistence.LockModeTypeprotected ValueLoadContext.Queryprotected booleanprotected String
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionaddProperty(String name) Adds a key of a returned key-value pair.static ValueLoadContextcreate()Creates an instance of ValueLoadContextstatic ValueLoadContext.QuerycreateQuery(String queryString) Creates an instance of ValueLoadContext queryList<AccessConstraint<?>>getHints()jakarta.persistence.LockModeTypegetQuery()booleansetAccessConstraints(List<AccessConstraint<?>> accessConstraints) setHint(String hintName, Serializable value) Sets custom hint that should be used by the query.setHints(Map<String, Serializable> hints) Sets custom hints that should be used by the query.voidSets name of the property that represents an identifier of the returned KeyValueEntity.setJoinTransaction(boolean joinTransaction) voidsetLockMode(jakarta.persistence.LockModeType lockMode) setProperties(List<String> properties) The same as invokingaddProperty(String)multiple times.setQuery(ValueLoadContext.Query query) Sets query instancesetQueryString(String queryString) setStoreName(String storeName) Sets a data store name if it is different from the main database.toString()
- 
Field Details- 
storeName
- 
query
- 
softDeletionprotected boolean softDeletion
- 
idName
- 
properties
- 
accessConstraints
- 
hints
- 
joinTransactionprotected boolean joinTransaction
- 
lockModeprotected jakarta.persistence.LockModeType lockMode
 
- 
- 
Constructor Details- 
ValueLoadContextpublic ValueLoadContext()
 
- 
- 
Method Details- 
createCreates an instance of ValueLoadContext
- 
createQueryCreates an instance of ValueLoadContext query
- 
setQueryString- Specified by:
- setQueryStringin interface- DataLoadContext
- Parameters:
- queryString- JPQL query string. Only named parameters are supported.
- Returns:
- query definition object
 
- 
setLockModepublic void setLockMode(jakarta.persistence.LockModeType lockMode) - Specified by:
- setLockModein interface- DataLoadContext
- Parameters:
- lockMode- lock mode to be used when executing query
 
- 
getLockMode@Nullable public jakarta.persistence.LockModeType getLockMode()- Specified by:
- getLockModein interface- DataLoadContext
- Returns:
- lock mode to be used when executing query
 
- 
getStoreName- Returns:
- data store name if set by setStoreName(String)
 
- 
setStoreNameSets a data store name if it is different from the main database.- Returns:
- this instance for chaining
 
- 
setQuerySets query instance- Returns:
- this instance for chaining
 
- 
getQuery- Returns:
- query instance
 
- 
getHints- Returns:
- custom hints which are used by the query
 
- 
setHintSets custom hint that should be used by the query.
- 
setHintsSets custom hints that should be used by the query.
- 
getIdName- Returns:
- name of property that represents an identifier of the returned KeyValueEntity, if set by setIdName(String)
 
- 
setIdNameSets name of the property that represents an identifier of the returned KeyValueEntity.
- 
addPropertyAdds a key of a returned key-value pair. The sequence of adding properties must conform to the sequence of result fields in the query "select" clause.For example, if the query is select e.id, e.name from sample$Customerand you executedcontext.addProperty("customerId").addProperty("customerName"), the returned KeyValueEntity will contain customer identifiers in "customerId" property and names in "customerName" property.- Returns:
- this instance for chaining
 
- 
setPropertiesThe same as invokingaddProperty(String)multiple times.- Returns:
- this instance for chaining
 
- 
getProperties- Returns:
- the list of properties added by addProperty(String)
 
- 
getAccessConstraints
- 
setAccessConstraints
- 
isJoinTransactionpublic boolean isJoinTransaction()
- 
setJoinTransaction
- 
toString
 
-