Class JDOQLSingleStringParser

  • public class JDOQLSingleStringParser
    extends Object
    Parser for handling JDOQL Single-String queries. Takes a JDOQLQuery and the query string and parses it into its constituent parts, updating the JDOQLQuery accordingly with the result that after calling the parse() method the JDOQLQuery is populated.
     select [unique] [{result}] [into {result-class-name}]
                                  [from {candidate-class-name} [exclude subclasses] ]
                                  [where {filter}]
                                  [variables {variables-clause} ]
                                  [parameters {parameters-clause} ]
                                  [group by {grouping-clause} ]
                                  [order by {ordering-clause} ]
                                  [range {from-range} ,{to-range}]                                       
     UPDATE {candidate-class-name} SET fld1 = val[, fld2 = val2] WHERE {filter}
     DELETE FROM {candidate-class-name} [exclude-subclasses] WHERE {filter}
    Note that {filter} can contain subqueries, hence containing keywords
     SELECT c FROM Customer c WHERE timeAvailable < (SELECT avg(hours) FROM Employee e)
    So the "filter" for the outer query is "timeAvailable < (SELECT avg(hours) FROM Employee e)"
    • Constructor Detail

      • JDOQLSingleStringParser

        public JDOQLSingleStringParser​(Query query,
                                       String queryString)
        Constructor for the Single-String parser.
        query - The query
        queryString - The Single-String query
    • Method Detail

      • setAllowDelete

        public void setAllowDelete​(boolean allow)
      • setAllowUpdate

        public void setAllowUpdate​(boolean allow)
      • parse

        public void parse()
        Method to parse the Single-String query