org.datanucleus.query
Class SQLSingleStringParser
java.lang.Object
org.datanucleus.query.SQLSingleStringParser
public class SQLSingleStringParser
- extends java.lang.Object
Parser for handling (simple) SQL string-based queries.
Takes a SQLQuery and the query string and parses it into its constituent parts, updating
the SQLQuery accordingly with the result that after calling the parse() method the SQLQuery
is populated.
SELECT [ {result} ]
[FROM {candidate-classes} ]
[WHERE {filter}]
[GROUP BY {grouping-clause} ]
[HAVING {having-clause} ]
[ORDER BY {ordering-clause}]
e.g SELECT t.COL1 FROM MYTABLE t WHERE t.COL2 = 1
Note that {filter} and {having-clause} can contain subqueries, hence containing keywords
SELECT c FROM Customer c WHERE NOT EXISTS (SELECT o1 FROM c.orders o1)
So the "filter" for the outer query is "NOT EXISTS (SELECT o1 FROM c.orders o1)"
|
Method Summary |
void |
parse()
Method to parse the Single-String query |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOCALISER
protected static final Localiser LOCALISER
- Localiser for messages.
SQLSingleStringParser
public SQLSingleStringParser(Query query,
java.lang.String queryString)
- Constructor for the Single-String parser.
- Parameters:
query - The query into which we populate the components of the queryqueryString - The Single-String query
parse
public void parse()
- Method to parse the Single-String query
Copyright © 2010. All Rights Reserved.