Class HQLQuery
java.lang.Object
com.atlassian.crowd.search.hibernate.HQLQuery
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
protected String
protected String
protected Comparator
protected boolean
protected Integer
protected final StringBuilder
protected int
protected final StringBuilder
protected boolean
protected boolean
protected final StringBuilder
protected int
protected final StringBuilder
protected boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddParameterPlaceholder
(Object value) Creates a variable placeholder for a parameterCreates a variable placeholder for a parameter.appendFrom
(CharSequence hql) appendSelect
(CharSequence hql) appendWhere
(CharSequence hql) Deprecated.use safeAppendWhere insteadReturns name of the multi-valued parameter that should be split into batches.Returns values of the multi-valued parameter that should be split into batches.int
int
int
boolean
void
limitResults
(int maxResults) void
offsetResults
(int startIndex) void
void
setCacheRegion
(String cacheRegion) void
setComparatorForBatch
(Comparator comparatorForBatch) sets comparator to merge results of batched queryvoid
setFetchSize
(Integer fetchSize) void
setReadOnly
(boolean readOnly) void
setResultTransform
(Function<List<Object[]>, List<?>> resultTransform) toString()
-
Field Details
-
select
-
from
-
where
-
orderBy
-
aliasCounter
protected int aliasCounter -
cacheRegion
-
distinctRequired
protected boolean distinctRequired -
whereRequired
protected boolean whereRequired -
orderByRequired
protected boolean orderByRequired -
readOnly
protected boolean readOnly -
parameterValues
-
maxResults
protected int maxResults -
startIndex
protected int startIndex -
fetchSize
-
batchedParam
-
comparatorForBatch
-
resultTransform
-
-
Constructor Details
-
HQLQuery
public HQLQuery()
-
-
Method Details
-
appendSelect
-
appendFrom
-
appendWhere
Deprecated.use safeAppendWhere instead- Parameters:
hql
- the text to append to the where clause- Returns:
- the stringbuilder representing the where clause
-
safeAppendWhere
-
appendOrderBy
-
getNextAlias
public int getNextAlias() -
addParameterPlaceholder
Creates a variable placeholder for a parameter- Parameters:
value
- actual value of the parameter, ornull
if the parameter is to be ignored- Returns:
- the JPA-style named variable (:param1, :param2, ...)
-
addParameterPlaceholderForBatchedParam
Creates a variable placeholder for a parameter. Marks the parameter as batched; the name and the values of the parameter may be retrieved usinggetBatchedParamName()
andgetBatchedParamValues()
. Only one parameter can be batched.- Parameters:
values
- values of the parameter that need to be batched- Returns:
- the JPA-style named variable (:param1, :param2, ...)
-
getComparatorForBatch
- Returns:
- comparator to merge results of batched query
-
setComparatorForBatch
sets comparator to merge results of batched query -
getParameterMap
- Returns:
- a list of parameter values. May contain
null
elements for parameters that are to be ignored
-
getParameterValues
-
setFetchSize
-
requireDistinct
public void requireDistinct() -
limitResults
public void limitResults(int maxResults) -
offsetResults
public void offsetResults(int startIndex) -
getFetchSize
-
getMaxResults
public int getMaxResults() -
getStartIndex
public int getStartIndex() -
isReadOnly
public boolean isReadOnly() -
setReadOnly
public void setReadOnly(boolean readOnly) -
getBatchedParamName
Returns name of the multi-valued parameter that should be split into batches. -
getBatchedParamValues
Returns values of the multi-valued parameter that should be split into batches. -
setResultTransform
-
getResultTransform
-
getCacheRegion
-
setCacheRegion
-
toString
-