Class SaQueryInfo

java.lang.Object
com.saperion.rmi.SaQueryInfo
All Implemented Interfaces:
Serializable

public class SaQueryInfo extends Object implements 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.
Author:
rbo
See Also:
  • Field Details

    • WORKFLOW_QUERY_PREFIX

      public static final String WORKFLOW_QUERY_PREFIX
      workflow query prefix.
      See Also:
    • WORKFLOW_AUDIT_QUERY_PREFIX

      public static final String WORKFLOW_AUDIT_QUERY_PREFIX
      workflow log query prefix.
      See Also:
    • FOLDER_QUERY_PREFIX

      public static final String FOLDER_QUERY_PREFIX
      folder query prefix.
      See Also:
    • DDC_NAME_PATTERN

      public static final Pattern DDC_NAME_PATTERN
      Pattern to match ddc-names.
  • Constructor Details

    • SaQueryInfo

      public SaQueryInfo(String query)
      Constructor.
      Parameters:
      query - Query string
    • SaQueryInfo

      public SaQueryInfo(String query, Map<String,Object> params)
      Constructor.
      Parameters:
      query - Query string
      params - Typed parameters with identifiers used in the query string
    • SaQueryInfo

      public SaQueryInfo(String query, Map<String,Object> params, Map<String,String> joinInfos)
      Constructor.
      Parameters:
      query - Query string
      params - Typed parameters with identifiers used in the query string
      joinInfos - 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

      public String getQueryString()
      Returns the query string.
      Returns:
      the query string
      See Also:
      • org.hibernate.query.Query#getQueryString()
    • setQueryString

      public void setQueryString(String query)
      Parameters:
      query - Query string
    • getParameters

      public Map<String,Object> getParameters()
      returns all parameters as a map
      Returns:
      Parameter map
    • getJoinInfos

      public Map<String,String> getJoinInfos()
      Returns:
      the join infos
      See Also:
    • setBigDecimal

      public void setBigDecimal(String name, BigDecimal value)
      See Also:
      • org.hibernate.query.Query#setBigDecimal(java.lang.String, java.math.BigDecimal)
    • setBigInteger

      public void setBigInteger(String name, BigInteger value)
      See Also:
      • org.hibernate.query.Query#setBigInteger(java.lang.String, java.math.BigInteger)
    • setBinary

      public void setBinary(String name, byte[] value)
      See Also:
      • org.hibernate.query.Query#setBinary(java.lang.String, byte[])
    • setBoolean

      public void setBoolean(String name, boolean value)
      See Also:
      • org.hibernate.query.Query#setBoolean(java.lang.String, boolean)
    • setByte

      public void setByte(String name, byte value)
      See Also:
      • org.hibernate.query.Query#setByte(java.lang.String, byte)
    • setCalendar

      public void setCalendar(String name, Calendar value)
      See Also:
      • org.hibernate.query.Query#setCalendar(java.lang.String, java.util.Calendar)
    • setCalendarDate

      public void setCalendarDate(String name, Calendar value)
      See Also:
      • org.hibernate.query.Query#setCalendarDate(java.lang.String, java.util.Calendar)
    • setCharacter

      public void setCharacter(String name, char value)
      See Also:
      • org.hibernate.query.Query#setCharacter(java.lang.String, char)
    • setDate

      public void setDate(String name, Date value)
      See Also:
      • org.hibernate.query.Query#setDate(java.lang.String, java.util.Date)
    • setDouble

      public void setDouble(String name, double value)
      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

      public void setFloat(String name, float value)
      See Also:
      • org.hibernate.query.Query#setFloat(java.lang.String, float)
    • setInteger

      public void setInteger(String name, int value)
      See Also:
      • org.hibernate.query.Query#setInteger(java.lang.String, int)
    • setLong

      public void setLong(String name, long value)
      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

      public void setParameter(String name, Object value)
      See Also:
      • org.hibernate.query.Query#setParameter(java.lang.String, java.lang.Object)
    • setParameterList

      public void setParameterList(String name, Collection<?> value)
      See Also:
      • org.hibernate.query.Query#setParameterList(java.lang.String, java.util.Collection)
    • setParameterList

      public void setParameterList(String name, Object[] value)
      See Also:
      • org.hibernate.query.Query#setParameterList(java.lang.String, java.lang.Object[])
    • setProperties

      public void setProperties(Map<? extends String,? extends Object> properties)
      See Also:
      • org.hibernate.query.Query#setProperties(java.util.Map)
    • setShort

      public void setShort(String name, short value)
      See Also:
      • org.hibernate.query.Query#setShort(java.lang.String, short)
    • setString

      public void setString(String name, String value)
      See Also:
      • org.hibernate.query.Query#setString(java.lang.String, java.lang.String)
    • setText

      public void setText(String name, String value)
      See Also:
      • org.hibernate.query.Query#setText(java.lang.String, java.lang.String)
    • setTime

      public void setTime(String name, Date value)
      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

      public void setTimestamp(String name, Date value)
      See Also:
      • org.hibernate.query.Query#setTimestamp(java.lang.String, java.util.Date)
    • getDdcName

      public String 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

      public SaQueryInfo.QueryCacheMode getCacheMode()
      Returns:
      Returns how the Query should be cached, if isCacheable returns true.
    • setCacheMode

      public void setCacheMode(SaQueryInfo.QueryCacheMode newCacheMode)
      Parameters:
      newCacheMode - The CacheMode which should be used, if the Query is cacheable.
    • setIndexStates

      public void setIndexStates(EnumSet<SaQueryInfo.IndexState> indexStates)
      Sets the index states of documents that will be included in the query result. By default, the query will return documents with index state 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).
      Parameters:
      indexStates - index states to include. If null or empty, the query will return documents with index state SaQueryInfo.IndexState.NORMAL.
    • getIndexStates

      public EnumSet<SaQueryInfo.IndexState> getIndexStates()
      Returns:
      index states of documents that will be included in the query result
    • getCustomIndexState

      public SaQueryInfo.CustomIndexState getCustomIndexState()
      Returns:
      CustomIndexState, which will have value and limit of field
    • setCustomIndexState

      public void setCustomIndexState(SaQueryInfo.CustomIndexState customIndexState)
      Set CustomIndexState, which will have value and limit of field
    • toString

      public String toString()
      puts together the query string, that consists of the Query, FetchSize, FirstResult, MaxResult, TimeOut and the set parameters.
      Overrides:
      toString in class Object
      See Also: