public class ValueLoadContext extends java.lang.Object implements DataLoadContext, java.io.Serializable
DataManager.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 boolean |
authorizationRequired |
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.lang.String |
getIdName() |
java.util.List<java.lang.String> |
getProperties() |
ValueLoadContext.Query |
getQuery() |
java.lang.String |
getStoreName() |
boolean |
isAuthorizationRequired() |
boolean |
isJoinTransaction() |
boolean |
isSoftDeletion() |
ValueLoadContext |
setAuthorizationRequired(boolean authorizationRequired) |
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 |
setSoftDeletion(boolean softDeletion) |
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 boolean authorizationRequired
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 ValueLoadContext setSoftDeletion(boolean softDeletion)
softDeletion
- whether to use soft deletion when loading entitiespublic boolean isSoftDeletion()
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 boolean isAuthorizationRequired()
public ValueLoadContext setAuthorizationRequired(boolean authorizationRequired)
public boolean isJoinTransaction()
public ValueLoadContext setJoinTransaction(boolean joinTransaction)
public java.lang.String toString()
toString
in class java.lang.Object