public class ValueLoadContext extends java.lang.Object implements DataLoadContext, java.io.Serializable
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");
Modifier and Type | Class and Description |
---|---|
static class |
ValueLoadContext.Query
Class that defines a query to be executed for loading values.
|
Modifier and Type | Field and Description |
---|---|
protected java.util.List<AccessConstraint<?>> |
accessConstraints |
protected java.util.Map<java.lang.String,java.io.Serializable> |
hints |
protected java.lang.String |
idName |
protected boolean |
joinTransaction |
protected java.util.List<java.lang.String> |
properties |
protected ValueLoadContext.Query |
query |
protected boolean |
softDeletion |
protected java.lang.String |
storeName |
Constructor and Description |
---|
ValueLoadContext() |
Modifier and Type | Method and Description |
---|---|
ValueLoadContext |
addProperty(java.lang.String name)
Adds a key of a returned key-value pair.
|
static ValueLoadContext |
create()
Creates an instance of ValueLoadContext
|
static ValueLoadContext.Query |
createQuery(java.lang.String queryString)
Creates an instance of ValueLoadContext query
|
java.util.List<AccessConstraint<?>> |
getAccessConstraints() |
java.util.Map<java.lang.String,java.lang.Object> |
getHints() |
java.lang.String |
getIdName() |
java.util.List<java.lang.String> |
getProperties() |
ValueLoadContext.Query |
getQuery() |
java.lang.String |
getStoreName() |
boolean |
isJoinTransaction() |
ValueLoadContext |
setAccessConstraints(java.util.List<AccessConstraint<?>> accessConstraints) |
ValueLoadContext |
setHint(java.lang.String hintName,
java.io.Serializable value)
Sets custom hint that should be used by the query.
|
ValueLoadContext |
setHints(java.util.Map<java.lang.String,java.io.Serializable> hints)
Sets custom hints that should be used by the query.
|
void |
setIdName(java.lang.String idName)
Sets name of the property that represents an identifier of the returned KeyValueEntity.
|
ValueLoadContext |
setJoinTransaction(boolean joinTransaction) |
ValueLoadContext |
setProperties(java.util.List<java.lang.String> properties)
The same as invoking
addProperty(String) multiple times. |
ValueLoadContext |
setQuery(ValueLoadContext.Query query)
Sets query instance
|
ValueLoadContext.Query |
setQueryString(java.lang.String queryString) |
ValueLoadContext |
setStoreName(java.lang.String storeName)
Sets a data store name if it is different from the main database.
|
java.lang.String |
toString() |
protected java.lang.String storeName
protected ValueLoadContext.Query query
protected boolean softDeletion
protected java.lang.String idName
protected java.util.List<java.lang.String> properties
protected java.util.List<AccessConstraint<?>> accessConstraints
protected java.util.Map<java.lang.String,java.io.Serializable> hints
protected boolean joinTransaction
public static ValueLoadContext create()
public static ValueLoadContext.Query createQuery(java.lang.String queryString)
public ValueLoadContext.Query setQueryString(java.lang.String queryString)
setQueryString
in interface DataLoadContext
queryString
- JPQL query string. Only named parameters are supported.public java.lang.String getStoreName()
setStoreName(String)
public ValueLoadContext setStoreName(java.lang.String storeName)
public ValueLoadContext setQuery(ValueLoadContext.Query query)
public ValueLoadContext.Query getQuery()
public java.util.Map<java.lang.String,java.lang.Object> getHints()
public ValueLoadContext setHint(java.lang.String hintName, java.io.Serializable value)
public ValueLoadContext setHints(java.util.Map<java.lang.String,java.io.Serializable> hints)
public java.lang.String getIdName()
setIdName(String)
public void setIdName(java.lang.String idName)
public ValueLoadContext addProperty(java.lang.String name)
For example, if the query is select e.id, e.name from sample$Customer
and you executed context.addProperty("customerId").addProperty("customerName")
, the returned KeyValueEntity
will contain customer identifiers in "customerId" property and names in "customerName" property.
public ValueLoadContext setProperties(java.util.List<java.lang.String> properties)
addProperty(String)
multiple times.public java.util.List<java.lang.String> getProperties()
addProperty(String)
public java.util.List<AccessConstraint<?>> getAccessConstraints()
public ValueLoadContext setAccessConstraints(java.util.List<AccessConstraint<?>> accessConstraints)
public boolean isJoinTransaction()
public ValueLoadContext setJoinTransaction(boolean joinTransaction)
public java.lang.String toString()
toString
in class java.lang.Object