com.ibm.commerce.member.search

Class ECQuery

  • java.lang.Object
    • com.ibm.commerce.member.search.ECQuery
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String CLASSNAME
      The class name.
      static java.lang.String COPYRIGHT
      IBM Copyright
      static java.lang.Integer DEFAULT_START
      Default start position.
      static java.lang.Integer UNDEFINED_MAX_RESULTS
      Default maximum number of results to fetch.
    • Constructor Summary

      Constructors 
      Constructor and Description
      ECQuery()
      Default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.util.Vector executeQuery(java.sql.Connection aConnection)
      Build up the search query based on the defined parameters, and execute it.
      TableField[] getAdditionalSelectTableFields()
      This method returns the additional TableField objects defined for the SELECT clause.
      java.lang.Integer getMaxResults()
      Get the value for the maximum number of results to return.
      TableField getOrderBy()
      Get the ORDER BY clause.
      java.lang.Integer getResultSize()
      Get the count of all elements matched by this search.
      boolean getRetrieveCountOnly()
      Get whether or not to retrieve the count only.
      java.lang.Integer getStart()
      Get the value for the start cursor position.
      boolean getUncommittedRead()
      Get whether or not to use UNCOMMITTED READ in the query.
      WhereClauseCondition getWhereClause()
      Gets the WhereClauseCondition object to be used to generate the WHERE clause(s) used by this query.
      boolean isValid()
      Sanity check on the query, check that the parameters are properly initialized.
      void setAdditionalSelectTableFields(TableField[] atfAdditionalSelectTableFields)
      Set the additional TableField objects to return as part of this query execution.
      void setAllFromTables(java.util.Set aSetFromTables)
      Set the FROM Tables for the search query If not specified, by default, the FROM tables will be taken from the SELECT, WHERE and JOIN clauses.
      void setMaxResults(java.lang.Integer aInMaxResults)
      Set the value for the maximum number of results to return.
      void setOrderBy(TableField atfOrderBy)
      Set the ORDER BY clause.
      void setRetrieveCountOnly(boolean abRetrieveCountOnly)
      Set whether or not to retrieve the count only.
      void setStart(java.lang.Integer anStart)
      Set the value for the start cursor position.
      void setUncommittedRead(boolean abUncomittedRead)
      Set whether or not to use UNCOMMITTED READ in the query.
      void setWhereClause(WhereClauseCondition aWhereClause)
      Set the WHERE clauses for this query.
      java.lang.String toString()
      Print the object, for tracing purposes.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM Copyright
        See Also:
        Constant Field Values
      • CLASSNAME

        public static final java.lang.String CLASSNAME
        The class name.
      • DEFAULT_START

        public static final java.lang.Integer DEFAULT_START
        Default start position.
      • UNDEFINED_MAX_RESULTS

        public static final java.lang.Integer UNDEFINED_MAX_RESULTS
        Default maximum number of results to fetch.
    • Constructor Detail

      • ECQuery

        public ECQuery()
        Default constructor.
    • Method Detail

      • getWhereClause

        public WhereClauseCondition getWhereClause()
        Gets the WhereClauseCondition object to be used to generate the WHERE clause(s) used by this query.
        Returns:
        WhereClauseCondition The WHERE clause.
      • setWhereClause

        public void setWhereClause(WhereClauseCondition aWhereClause)
        Set the WHERE clauses for this query.
        Parameters:
        aWhereClause - The WHERE clause.
      • getAdditionalSelectTableFields

        public final TableField[] getAdditionalSelectTableFields()
        This method returns the additional TableField objects defined for the SELECT clause. These fields will be returned in addition to those values specified in the getDefaultSelectTableFields() method. For query execution, the default SELECT fields will go first, then the additional SELECT fields.
        Returns:
        The additional SELECT fields defined for this query instance.
      • setAdditionalSelectTableFields

        public final void setAdditionalSelectTableFields(TableField[] atfAdditionalSelectTableFields)
        Set the additional TableField objects to return as part of this query execution.
        Parameters:
        atfAdditionalSelectTableFields - The additional TableField objects to use as part of the SELECT process.
      • getMaxResults

        public java.lang.Integer getMaxResults()
        Get the value for the maximum number of results to return.
        Returns:
        The value for the maximum number of results to return from executing the query.
      • setMaxResults

        public void setMaxResults(java.lang.Integer aInMaxResults)
        Set the value for the maximum number of results to return.
        Parameters:
        aInMaxResults - The value for the maximum number of results to return.
      • getRetrieveCountOnly

        public boolean getRetrieveCountOnly()
        Get whether or not to retrieve the count only. The default value is false, which means that the query will execute and return the full java.sql.ResultSet.
        Returns:
        true if the query should return the count only; false otherwise
      • setRetrieveCountOnly

        public void setRetrieveCountOnly(boolean abRetrieveCountOnly)
        Set whether or not to retrieve the count only.
        Parameters:
        abRetrieveCountOnly - true if the query should return the count only; false if it should return the full java.sql.ResultSet .
      • getStart

        public java.lang.Integer getStart()
        Get the value for the start cursor position.
        Returns:
        The cursor start position.
      • setStart

        public void setStart(java.lang.Integer anStart)
        Set the value for the start cursor position.
        Parameters:
        anStart - The cursor start position.
      • getResultSize

        public java.lang.Integer getResultSize()
        Get the count of all elements matched by this search.
        Returns:
        The result size
      • getOrderBy

        public TableField getOrderBy()
        Get the ORDER BY clause.
        Returns:
        TableField The ORDER BY clause.
      • setOrderBy

        public void setOrderBy(TableField atfOrderBy)
        Set the ORDER BY clause.
        Parameters:
        atfOrderBy - The ORDER BY clause.
      • executeQuery

        public java.util.Vector executeQuery(java.sql.Connection aConnection)
                                      throws java.sql.SQLException
        Build up the search query based on the defined parameters, and execute it. This method is for IBM internal use only.
        Parameters:
        aConnection - The database connection.
        Returns:
        The results of executing the query. Stored as a Vector of Vectors. Each of the outer Vectors represents rows in the java.sql.ResultSet , each of the inner Vectors represents the fields returned.
        Throws:
        java.sql.SQLException - If an exception is thrown from executing the query.
      • isValid

        public boolean isValid()
        Sanity check on the query, check that the parameters are properly initialized. The start and max results must be defined, the SELECT table/fields must be specified, and there must be at least one entry in the FROM tables list.
        Returns:
        true if the query object is valid; false otherwise
      • toString

        public java.lang.String toString()
        Print the object, for tracing purposes.
        Overrides:
        toString in class java.lang.Object
        Returns:
        String The string representation of the object.
      • setUncommittedRead

        public void setUncommittedRead(boolean abUncomittedRead)
        Set whether or not to use UNCOMMITTED READ in the query. By default, it is set to false.
        Parameters:
        abUncomittedRead - true will append WITH UR to the end of the query.
      • getUncommittedRead

        public boolean getUncommittedRead()
        Get whether or not to use UNCOMMITTED READ in the query.
        Returns:
        true if the query uses UNCOMMITTED READ; false otherwise
      • setAllFromTables

        public void setAllFromTables(java.util.Set aSetFromTables)
        Set the FROM Tables for the search query If not specified, by default, the FROM tables will be taken from the SELECT, WHERE and JOIN clauses. It is better to use the default rather than setting the FROM tables if possible because you will then need to ensure that your specified FROM tables match the rest of the constructed SQL.
        Parameters:
        aSetFromTables - The set of FROM Tables