Class HQLQuery
java.lang.Object
com.atlassian.crowd.search.hibernate.HQLQuery
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected Stringprotected Stringprotected Comparatorprotected booleanprotected Integerprotected final StringBuilderprotected intprotected final StringBuilderprotected booleanprotected booleanprotected final StringBuilderprotected intprotected final StringBuilderprotected boolean -
Constructor Summary
Constructors -
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.intintintbooleanvoidlimitResults(int maxResults) voidoffsetResults(int startIndex) voidvoidsetCacheRegion(String cacheRegion) voidsetComparatorForBatch(Comparator comparatorForBatch) sets comparator to merge results of batched queryvoidsetFetchSize(Integer fetchSize) voidsetReadOnly(boolean readOnly) voidsetResultTransform(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, ornullif 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
nullelements 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
-