org.datanucleus.query.compiler
Class SQLCompiler
java.lang.Object
org.datanucleus.query.compiler.JavaQueryCompiler
org.datanucleus.query.compiler.SQLCompiler
- All Implemented Interfaces:
- SymbolResolver
public class SQLCompiler
- extends JavaQueryCompiler
Implementation of a compiler for SQL (simplified ANSI-like SQL for non-RDBMS).
Supported SQL is not "SQL" as such, but involves classes/field names.
Examples :-
SELECT * FROM Contact
Will select objects of type Contact, where "Contact" is the name of some class resolved
by use of the imports and aliases in MetaData.
In general it will support :-
SELECT {resultExpr}
FROM {fromExpr}
WHERE {whereExpr}
GROUP BY {groupExpr}
HAVING {havingExpr}
ORDER BY {orderExpr}
approximately following JPQL (which is virtually SQL anyway)
| Fields inherited from class org.datanucleus.query.compiler.JavaQueryCompiler |
candidateAlias, candidateClass, candidates, clr, filter, from, grouping, having, imports, metaDataManager, ordering, parameters, parser, result, symtbl, variables |
|
Constructor Summary |
SQLCompiler(MetaDataManager metaDataManager,
ClassLoaderResolver clr,
java.lang.String from,
java.lang.Class candidateClass,
java.util.Collection candidates,
java.lang.String filter,
Imports imports,
java.lang.String ordering,
java.lang.String result,
java.lang.String grouping,
java.lang.String having,
java.lang.String params)
|
|
Method Summary |
QueryCompilation |
compile(java.util.Map parameters)
Method to compile the query, and return the compiled results. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SQLCompiler
public SQLCompiler(MetaDataManager metaDataManager,
ClassLoaderResolver clr,
java.lang.String from,
java.lang.Class candidateClass,
java.util.Collection candidates,
java.lang.String filter,
Imports imports,
java.lang.String ordering,
java.lang.String result,
java.lang.String grouping,
java.lang.String having,
java.lang.String params)
compile
public QueryCompilation compile(java.util.Map parameters)
- Method to compile the query, and return the compiled results.
- Specified by:
compile in class JavaQueryCompiler
- Parameters:
parameters - the parameter map of values keyed by param name
- Returns:
- The compiled query
Copyright © 2009. All Rights Reserved.