Class CmsSelectQuery

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  CmsSelectQuery.TableAlias
      Helper class which wraps a table alias.
    • Constructor Summary

      Constructors 
      Constructor Description
      CmsSelectQuery()
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addClause​(I_CmsQueryFragment clause)
      Adds another clause to the query.
      void addColumn​(java.lang.String column)
      Adds an expression which should be added as a column in the result set.
      void addColumn​(I_CmsQueryFragment node)
      Adds an expression which should be added as a column in the result set.
      void addCondition​(java.lang.String fragment, java.lang.Object... params)
      Adds a new condition to the query.
      void addCondition​(I_CmsQueryFragment node)
      Adds a new condition to the query.
      void addTable​(java.lang.String table)
      Adds a table to the query's FROM clause.
      CmsSelectQuery.TableAlias addTable​(java.lang.String table, java.lang.String aliasPrefix)
      Adds a table the query's FROM clause.
      I_CmsQueryFragment getOrdering()
      Returns the fragment for the ORDER BY clause.
      void setOrdering​(java.lang.String ordering)
      Sets the SQL used for the ORDER BY clause.
      void visit​(CmsStatementBuilder builder)
      Generates the SQL and parameters and sends them to the statement builder .
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • addClause

        public void addClause​(I_CmsQueryFragment clause)
        Adds another clause to the query.

        Parameters:
        clause - the clause to add
      • addColumn

        public void addColumn​(I_CmsQueryFragment node)
        Adds an expression which should be added as a column in the result set.

        Parameters:
        node - the expression which should be added as a column
      • addColumn

        public void addColumn​(java.lang.String column)
        Adds an expression which should be added as a column in the result set.

        Parameters:
        column - the expression which should be added as a column
      • addCondition

        public void addCondition​(I_CmsQueryFragment node)
        Adds a new condition to the query.

        Parameters:
        node - the condition to add to the query
      • addCondition

        public void addCondition​(java.lang.String fragment,
                                 java.lang.Object... params)
        Adds a new condition to the query.

        Parameters:
        fragment - the condition SQL
        params - the condition parameters
      • addTable

        public void addTable​(java.lang.String table)
        Adds a table to the query's FROM clause.

        Parameters:
        table - the table to add
      • addTable

        public CmsSelectQuery.TableAlias addTable​(java.lang.String table,
                                                  java.lang.String aliasPrefix)
        Adds a table the query's FROM clause.

        Parameters:
        table - the table to add
        aliasPrefix - the prefix used to generate the alias
        Returns:
        an alias for the table
      • getOrdering

        public I_CmsQueryFragment getOrdering()
        Returns the fragment for the ORDER BY clause.

        Returns:
        the fragment for the ORDER BY clause
      • setOrdering

        public void setOrdering​(java.lang.String ordering)
        Sets the SQL used for the ORDER BY clause.

        Parameters:
        ordering - the SQL used for the ORDER BY clause