Package org.datanucleus.store.query
Class JDOQLSingleStringParser
- java.lang.Object
-
- org.datanucleus.store.query.JDOQLSingleStringParser
-
public class JDOQLSingleStringParser extends java.lang.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} ] [{imports-clause}] [group by {grouping-clause} ] [order by {ordering-clause} ] [range {from-range} ,{to-range}]
orUPDATE {candidate-class-name} SET fld1 = val[, fld2 = val2] WHERE {filter}
orDELETE FROM {candidate-class-name} [exclude-subclasses] WHERE {filter}
Note that {filter} can contain subqueries, hence containing keywordsSELECT 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)"
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
JDOQLSingleStringParser.Compiler
Compiler to process keywords contents.private static class
JDOQLSingleStringParser.Parser
Tokenizer that provides access to current token.
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean
allowDelete
(package private) boolean
allowUpdate
private Query
query
The JDOQL query to populate.private java.lang.String
queryString
The single-string query string.
-
Constructor Summary
Constructors Constructor Description JDOQLSingleStringParser(Query query, java.lang.String queryString)
Constructor for the Single-String parser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
parse()
Method to parse the Single-String queryvoid
setAllowDelete(boolean allow)
void
setAllowUpdate(boolean allow)
-
-
-
Field Detail
-
query
private Query query
The JDOQL query to populate.
-
queryString
private java.lang.String queryString
The single-string query string.
-
allowDelete
boolean allowDelete
-
allowUpdate
boolean allowUpdate
-
-
Constructor Detail
-
JDOQLSingleStringParser
public JDOQLSingleStringParser(Query query, java.lang.String queryString)
Constructor for the Single-String parser.- Parameters:
query
- The queryqueryString
- The Single-String query
-
-