Package com.saperion.rmi
Class SaQueryInfo
java.lang.Object
com.saperion.rmi.SaQueryInfo
- All Implemented Interfaces:
Serializable
Holds the information about a hibernate sql query.
The query string and the parameter can be set here to perform a database query against the backend.
See the searchHql method in the SaClassicConnector interface.
The query string and the parameter can be set here to perform a database query against the backend.
See the searchHql method in the SaClassicConnector interface.
- Author:
- rbo
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Custom IndexState for instances where Query is made on non standard values of SYSINDEXSTATEstatic enum
Index states of documents that can be included in a query-result.static enum
Cache modes from hibernate. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSaQueryInfo
(String query) Constructor.SaQueryInfo
(String query, Map<String, Object> params) Constructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionExtracts the ddc name from the query string.int
int
int
returns all parameters as a mapReturns the query string.int
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
void
setBigDecimal
(String name, BigDecimal value) void
setBigInteger
(String name, BigInteger value) void
void
setBoolean
(String name, boolean value) void
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
setCustomIndexState
(SaQueryInfo.CustomIndexState customIndexState) Set CustomIndexState, which will have value and limit of fieldvoid
void
void
setFetchSize
(int value) void
setFirstResult
(int value) void
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
void
setMaxResults
(int value) void
setParameter
(String name, Object value) void
setParameterList
(String name, Object[] value) void
setParameterList
(String name, Collection<?> value) void
setProperties
(Map<? extends String, ? extends Object> properties) void
setQueryString
(String query) void
void
void
void
void
setTimeout
(int value) void
setTimestamp
(String name, Date value) toString()
puts together the query string, that consists of the Query, FetchSize, FirstResult, MaxResult, TimeOut and the set parameters.
-
Field Details
-
WORKFLOW_QUERY_PREFIX
workflow query prefix.- See Also:
-
WORKFLOW_AUDIT_QUERY_PREFIX
workflow log query prefix.- See Also:
-
FOLDER_QUERY_PREFIX
folder query prefix.- See Also:
-
DDC_NAME_PATTERN
Pattern to match ddc-names.
-
-
Constructor Details
-
SaQueryInfo
Constructor.- Parameters:
query
- Query string
-
SaQueryInfo
Constructor.- Parameters:
query
- Query stringparams
- Typed parameters with identifiers used in the query string
-
SaQueryInfo
Constructor.- Parameters:
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.
-
-
Method Details
-
getQueryString
Returns the query string.- Returns:
- the query string
- See Also:
-
org.hibernate.query.Query#getQueryString()
-
setQueryString
- Parameters:
query
- Query string
-
getParameters
returns all parameters as a map- Returns:
- Parameter map
-
getJoinInfos
- Returns:
- the join infos
- See Also:
-
setBigDecimal
- See Also:
-
org.hibernate.query.Query#setBigDecimal(java.lang.String, java.math.BigDecimal)
-
setBigInteger
- See Also:
-
org.hibernate.query.Query#setBigInteger(java.lang.String, java.math.BigInteger)
-
setBinary
- See Also:
-
org.hibernate.query.Query#setBinary(java.lang.String, byte[])
-
setBoolean
- See Also:
-
org.hibernate.query.Query#setBoolean(java.lang.String, boolean)
-
setByte
- See Also:
-
org.hibernate.query.Query#setByte(java.lang.String, byte)
-
setCalendar
- See Also:
-
org.hibernate.query.Query#setCalendar(java.lang.String, java.util.Calendar)
-
setCalendarDate
- See Also:
-
org.hibernate.query.Query#setCalendarDate(java.lang.String, java.util.Calendar)
-
setCharacter
- See Also:
-
org.hibernate.query.Query#setCharacter(java.lang.String, char)
-
setDate
- See Also:
-
org.hibernate.query.Query#setDate(java.lang.String, java.util.Date)
-
setDouble
- See Also:
-
org.hibernate.query.Query#setDouble(java.lang.String, double)
-
setFetchSize
public void setFetchSize(int value) - See Also:
-
org.hibernate.query.Query#setFetchSize(int)
-
hasFetchSize
public boolean hasFetchSize()- Returns:
- Has fetchsize
-
getFetchSize
public int getFetchSize()- Returns:
- Fetchsize
-
setFirstResult
public void setFirstResult(int value) - See Also:
-
org.hibernate.query.Query#setFirstResult(int)
-
hasFirstResult
public boolean hasFirstResult()- Returns:
- Has first result
-
getFirstResult
public int getFirstResult()- Returns:
- First result
-
setFloat
- See Also:
-
org.hibernate.query.Query#setFloat(java.lang.String, float)
-
setInteger
- See Also:
-
org.hibernate.query.Query#setInteger(java.lang.String, int)
-
setLong
- See Also:
-
org.hibernate.query.Query#setLong(java.lang.String, long)
-
setMaxResults
public void setMaxResults(int value) - See Also:
-
org.hibernate.query.Query#setMaxResults(int)
-
hasMaxResult
public boolean hasMaxResult()- Returns:
- Has max result
-
getMaxResult
public int getMaxResult()- Returns:
- Max result
-
setParameter
- See Also:
-
org.hibernate.query.Query#setParameter(java.lang.String, java.lang.Object)
-
setParameterList
- See Also:
-
org.hibernate.query.Query#setParameterList(java.lang.String, java.util.Collection)
-
setParameterList
- See Also:
-
org.hibernate.query.Query#setParameterList(java.lang.String, java.lang.Object[])
-
setProperties
- See Also:
-
org.hibernate.query.Query#setProperties(java.util.Map)
-
setShort
- See Also:
-
org.hibernate.query.Query#setShort(java.lang.String, short)
-
setString
- See Also:
-
org.hibernate.query.Query#setString(java.lang.String, java.lang.String)
-
setText
- See Also:
-
org.hibernate.query.Query#setText(java.lang.String, java.lang.String)
-
setTime
- See Also:
-
org.hibernate.query.Query#setTime(java.lang.String, java.util.Date)
-
setTimeout
public void setTimeout(int value) - See Also:
-
org.hibernate.query.Query#setTimeout(int)
-
hasTimeout
public boolean hasTimeout()- Returns:
- Has timeout
-
getTimeout
public int getTimeout()- Returns:
- Timeout
-
setTimestamp
- See Also:
-
org.hibernate.query.Query#setTimestamp(java.lang.String, java.util.Date)
-
getDdcName
Extracts the ddc name from the query string.- Returns:
- ddc name
-
isWorkflowQuery
public boolean isWorkflowQuery()- Returns:
true
if it is a workflow specific query.
-
isWorkflowAuditQuery
public boolean isWorkflowAuditQuery()- Returns:
true
if it is a workflow audit specific query.
-
isFolderQuery
public boolean isFolderQuery()- Returns:
true
if it is a folder specific query.
-
isCacheable
public boolean isCacheable()- Returns:
true
if the query could be cached.
-
setCacheable
public void setCacheable(boolean cacheable) - Parameters:
cacheable
-true
if the query should be tried to cache.
-
getCacheMode
- Returns:
- Returns how the Query should be cached, if isCacheable returns true.
-
setCacheMode
- Parameters:
newCacheMode
- The CacheMode which should be used, if the Query is cacheable.
-
setIndexStates
Sets the index states of documents that will be included in the query result. By default, the query will return documents with index stateSaQueryInfo.IndexState.NORMAL
. Note thatSaQueryInfo.IndexState.REVISED
andSaQueryInfo.IndexState.DELETED
can only be included if the DDC includes the required system fields (SYSINDEXSTATE forSaQueryInfo.IndexState.DELETED
, SYSREVCOMMENT, SYSREVDATETIME, SYSREVVERSION and SYSREVREASON forSaQueryInfo.IndexState.REVISED
).- Parameters:
indexStates
- index states to include. If null or empty, the query will return documents with index stateSaQueryInfo.IndexState.NORMAL
.
-
getIndexStates
- Returns:
- index states of documents that will be included in the query result
-
getCustomIndexState
- Returns:
- CustomIndexState, which will have value and limit of field
-
setCustomIndexState
Set CustomIndexState, which will have value and limit of field -
toString
puts together the query string, that consists of the Query, FetchSize, FirstResult, MaxResult, TimeOut and the set parameters.
-