public class SaQueryInfo extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
SaQueryInfo.IndexState
Index states of documents that can be included in a query-result.
|
static class |
SaQueryInfo.QueryCacheMode
Cache modes from hibernate.
|
Modifier and Type | Field and Description |
---|---|
static Pattern |
DDC_NAME_PATTERN
Pattern to match ddc-names.
|
static String |
FOLDER_QUERY_PREFIX
folder query prefix.
|
static String |
WORKFLOW_AUDIT_QUERY_PREFIX
workflow log query prefix.
|
static String |
WORKFLOW_QUERY_PREFIX
workflow query prefix.
|
Constructor and Description |
---|
SaQueryInfo(String query)
Constructor.
|
SaQueryInfo(String query,
Map<String,Object> params)
Constructor.
|
SaQueryInfo(String query,
Map<String,Object> params,
Map<String,String> joinInfos)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
SaQueryInfo.QueryCacheMode |
getCacheMode() |
String |
getDdcName()
Extracts the ddc name from the query string.
|
int |
getFetchSize() |
int |
getFirstResult() |
EnumSet<SaQueryInfo.IndexState> |
getIndexStates() |
Map<String,String> |
getJoinInfos() |
int |
getMaxResult() |
Map<String,Object> |
getParameters()
returns all parameters as a map
|
String |
getQueryString()
Returns the query string.
|
int |
getTimeout() |
boolean |
hasFetchSize() |
boolean |
hasFirstResult() |
boolean |
hasMaxResult() |
boolean |
hasTimeout() |
boolean |
isCacheable() |
boolean |
isFolderQuery() |
boolean |
isWorkflowAuditQuery() |
boolean |
isWorkflowQuery() |
void |
setBigDecimal(String name,
BigDecimal value) |
void |
setBigInteger(String name,
BigInteger value) |
void |
setBinary(String name,
byte[] value) |
void |
setBoolean(String name,
boolean value) |
void |
setByte(String name,
byte value) |
void |
setCacheable(boolean cacheable) |
void |
setCacheMode(SaQueryInfo.QueryCacheMode newCacheMode) |
void |
setCalendar(String name,
Calendar value) |
void |
setCalendarDate(String name,
Calendar value) |
void |
setCharacter(String name,
char value) |
void |
setDate(String name,
Date value) |
void |
setDouble(String name,
double value) |
void |
setFetchSize(int value) |
void |
setFirstResult(int value) |
void |
setFloat(String name,
float value) |
void |
setIndexStates(EnumSet<SaQueryInfo.IndexState> indexStates)
Sets the index states of documents that will be included in the query result.
|
void |
setInteger(String name,
int value) |
void |
setLong(String name,
long value) |
void |
setMaxResults(int value) |
void |
setParameter(String name,
Object value) |
void |
setParameterList(String name,
Collection<?> value) |
void |
setParameterList(String name,
Object[] value) |
void |
setProperties(Map<? extends String,? extends Object> properties) |
void |
setQueryString(String query) |
void |
setShort(String name,
short value) |
void |
setString(String name,
String value) |
void |
setText(String name,
String value) |
void |
setTime(String name,
Date value) |
void |
setTimeout(int value) |
void |
setTimestamp(String name,
Date value) |
String |
toString()
puts together the query string, that consists of the
Query, FetchSize, FirstResult, MaxResult, TimeOut and the set parameters.
|
public static final String WORKFLOW_QUERY_PREFIX
public static final String WORKFLOW_AUDIT_QUERY_PREFIX
public static final String FOLDER_QUERY_PREFIX
public static final Pattern DDC_NAME_PATTERN
public SaQueryInfo(String query)
query
- Query stringpublic SaQueryInfo(String query, Map<String,Object> params)
query
- Query stringparams
- Typed parameters with identifiers used in the query stringpublic SaQueryInfo(String query, Map<String,Object> params, Map<String,String> joinInfos)
query
- Query stringparams
- Typed parameters with identifiers used in the query stringjoinInfos
- Used to join one or more other tables. To be used only in
methods that use this SaQueryInfo as a filter and not as a
standalone query. Example: To join a multivalue table, put a
pair like 'f.MULTIVAL', 'multival' where f is the identifier
of the table to query, MULTIVAL is the name of the multivalue
property and multival is the identifier of the joined table.public String getQueryString()
org.hibernate.Query#getQueryString()
public void setQueryString(String query)
query
- Query stringpublic Map<String,Object> getParameters()
public Map<String,String> getJoinInfos()
SaQueryInfo(String, Map, Map)
public void setBigDecimal(String name, BigDecimal value)
org.hibernate.Query#setBigDecimal(java.lang.String,
java.math.BigDecimal)
public void setBigInteger(String name, BigInteger value)
org.hibernate.Query#setBigInteger(java.lang.String,
java.math.BigInteger)
public void setBinary(String name, byte[] value)
org.hibernate.Query#setBinary(java.lang.String, byte[])
public void setBoolean(String name, boolean value)
org.hibernate.Query#setBoolean(java.lang.String, boolean)
public void setByte(String name, byte value)
org.hibernate.Query#setByte(java.lang.String, byte)
public void setCalendar(String name, Calendar value)
org.hibernate.Query#setCalendar(java.lang.String,
java.util.Calendar)
public void setCalendarDate(String name, Calendar value)
org.hibernate.Query#setCalendarDate(java.lang.String,
java.util.Calendar)
public void setCharacter(String name, char value)
org.hibernate.Query#setCharacter(java.lang.String, char)
public void setDate(String name, Date value)
org.hibernate.Query#setDate(java.lang.String, java.util.Date)
public void setDouble(String name, double value)
org.hibernate.Query#setDouble(java.lang.String, double)
public void setFetchSize(int value)
org.hibernate.Query#setFetchSize(int)
public boolean hasFetchSize()
public int getFetchSize()
public void setFirstResult(int value)
org.hibernate.Query#setFirstResult(int)
public boolean hasFirstResult()
public int getFirstResult()
public void setFloat(String name, float value)
org.hibernate.Query#setFloat(java.lang.String, float)
public void setInteger(String name, int value)
org.hibernate.Query#setInteger(java.lang.String, int)
public void setLong(String name, long value)
org.hibernate.Query#setLong(java.lang.String, long)
public void setMaxResults(int value)
org.hibernate.Query#setMaxResults(int)
public boolean hasMaxResult()
public int getMaxResult()
public void setParameter(String name, Object value)
org.hibernate.Query#setParameter(java.lang.String, java.lang.Object)
public void setParameterList(String name, Collection<?> value)
org.hibernate.Query#setParameterList(java.lang.String,
java.util.Collection)
public void setParameterList(String name, Object[] value)
org.hibernate.Query#setParameterList(java.lang.String,
java.lang.Object[])
public void setProperties(Map<? extends String,? extends Object> properties)
org.hibernate.Query#setProperties(java.util.Map)
public void setShort(String name, short value)
org.hibernate.Query#setShort(java.lang.String, short)
public void setString(String name, String value)
org.hibernate.Query#setString(java.lang.String, java.lang.String)
public void setText(String name, String value)
org.hibernate.Query#setText(java.lang.String, java.lang.String)
public void setTime(String name, Date value)
org.hibernate.Query#setTime(java.lang.String, java.util.Date)
public void setTimeout(int value)
org.hibernate.Query#setTimeout(int)
public boolean hasTimeout()
public int getTimeout()
public void setTimestamp(String name, Date value)
org.hibernate.Query#setTimestamp(java.lang.String, java.util.Date)
public String getDdcName()
public boolean isWorkflowQuery()
true
if it is a workflow specific query.public boolean isWorkflowAuditQuery()
true
if it is a workflow audit specific query.public boolean isFolderQuery()
true
if it is a folder specific query.public boolean isCacheable()
true
if the query could be cached.public void setCacheable(boolean cacheable)
cacheable
- true
if the query should be tried to cache.public SaQueryInfo.QueryCacheMode getCacheMode()
public void setCacheMode(SaQueryInfo.QueryCacheMode newCacheMode)
newCacheMode
- The CacheMode which should be used, if the Query is cacheable.public void setIndexStates(EnumSet<SaQueryInfo.IndexState> indexStates)
SaQueryInfo.IndexState.NORMAL
.
Note that SaQueryInfo.IndexState.REVISED
and SaQueryInfo.IndexState.DELETED
can only be included
if the DDC includes the required system fields (SYSINDEXSTATE for SaQueryInfo.IndexState.DELETED
,
SYSREVCOMMENT, SYSREVDATETIME, SYSREVVERSION and SYSREVREASON for SaQueryInfo.IndexState.REVISED
).indexStates
- index states to include. If null or empty, the query will return documents with
index state SaQueryInfo.IndexState.NORMAL
.public EnumSet<SaQueryInfo.IndexState> getIndexStates()
public String toString()
toString
in class Object
Object.toString()
Copyright © 2020 Hyland Software Germany GmbH. All rights reserved.