Class QueryCompilation

  • All Implemented Interfaces:

    public class QueryCompilation
    extends Object
    implements Serializable
    Representation of the components of a compiled java "string-based" query. Assumes that the query has the following forms
     SELECT {result} FROM {from} WHERE {filter} GROUP BY {grouping} HAVING {having} ORDER BY {order}
     UPDATE {from} SET {update} WHERE {filter}
     DELETE FROM {from} WHERE {filter}
    See Also:
    Serialized Form
    • Field Detail

      • queryLanguage

        protected String queryLanguage
        Query language that this is a compilation for.
      • candidateClass

        protected Class candidateClass
        Primary candidate class.
      • candidateAlias

        protected String candidateAlias
        Alias for the (primary) candidate. Defaults to "this".
      • returnsSingleRow

        protected boolean returnsSingleRow
        Whether the query will return a single row.
      • symtbl

        protected SymbolTable symtbl
        Compiled Symbol Table.
      • resultDistinct

        protected boolean resultDistinct
        Whether the result is distinct.
      • exprResult

        protected Expression[] exprResult
        Compiled result expression.
      • exprFrom

        protected Expression[] exprFrom
        Compiled from expression.
      • exprUpdate

        protected Expression[] exprUpdate
        Compiled update expression.
      • exprFilter

        protected Expression exprFilter
        Compiled filter expression
      • exprGrouping

        protected Expression[] exprGrouping
        Compiled grouping expression.
      • exprHaving

        protected Expression exprHaving
        Compiled having expression.
      • exprOrdering

        protected Expression[] exprOrdering
        Compiled ordering expression.
      • subqueryCompilations

        protected Map<String,​QueryCompilation> subqueryCompilations
        Compilations of any subqueries, keyed by the subquery variable name.
    • Method Detail

      • setQueryLanguage

        public void setQueryLanguage​(String lang)
      • getQueryLanguage

        public String getQueryLanguage()
      • setResultDistinct

        public void setResultDistinct()
      • getResultDistinct

        public boolean getResultDistinct()
      • setReturnsSingleRow

        public void setReturnsSingleRow()
      • addSubqueryCompilation

        public void addSubqueryCompilation​(String alias,
                                           QueryCompilation compilation)
        Method to add the compilation for a subquery of this query.
        alias - Alias for the subquery (variable name)
        compilation - The compilation
      • getCompilationForSubquery

        public QueryCompilation getCompilationForSubquery​(String alias)
        Accessor for the compilation for a subquery with the specified alias.
        alias - Alias of subquery
        The compilation
      • getSubqueryAliases

        public String[] getSubqueryAliases()
        Accessor for the aliases for any subqueries in this compilation.
        The subquery aliases (if any)
      • returnsSingleRow

        public boolean returnsSingleRow()
        Accessor for whether this query will return a single row. This is true if all result selects are aggregates, or the user has set "unique" on the query.
        Whether this query will return a single row
      • getResultTypes

        public Class[] getResultTypes()
        Accessor for the types of the result row components. If no result is defined then will be an array of size 1 with element type "candidate".
        The result type(s)
      • getCandidateClass

        public Class getCandidateClass()
        Accessor for the candidate class.
        Candidate class
      • getCandidateAlias

        public String getCandidateAlias()
        Accessor for the candidate alias.
        Candidate alias
      • getSymbolTable

        public SymbolTable getSymbolTable()
        Accessor for the symbol table for the query.
        Symbol table, for parameter, variable lookup.
      • getExprResult

        public Expression[] getExprResult()
        Accessor for any result expression(s).
        The results
      • getExprFrom

        public Expression[] getExprFrom()
        Accessor for any from expression(s).
        The from clauses
      • getExprUpdate

        public Expression[] getExprUpdate()
        Accessor for any update expression(s).
        The updates
      • getExprFilter

        public Expression getExprFilter()
        Accessor for the filter expression.
        The filter
      • setExprFilter

        public void setExprFilter​(Expression filter)
      • getExprGrouping

        public Expression[] getExprGrouping()
        Accessor for any grouping expression(s).
        The grouping
      • getExprHaving

        public Expression getExprHaving()
        Accessor for any having expression.
        The having clause
      • setExprHaving

        public void setExprHaving​(Expression having)
      • getExprOrdering

        public Expression[] getExprOrdering()
        Accessor for any ordering expression(s).
        The ordering
      • getParameterExpressionForPosition

        public ParameterExpression getParameterExpressionForPosition​(int pos)
      • debugString

        public String debugString​(String indent)