Class JPQLCompiler
java.lang.Object
org.datanucleus.store.query.compiler.JavaQueryCompiler
org.datanucleus.store.query.compiler.JPQLCompiler
- All Implemented Interfaces:
SymbolResolver
Implementation of a compiler for JPQL (JSR0220, JSR0317).
-
Field Summary
Fields inherited from class JavaQueryCompiler
candidateAlias, candidateAliasOrig, candidateClass, candidates, caseSensitiveAliases, clr, filter, from, grouping, having, imports, JOIN_INNER, JOIN_INNER_FETCH, JOIN_OUTER, JOIN_OUTER_FETCH, JOIN_OUTER_FETCH_RIGHT, JOIN_OUTER_RIGHT, metaDataManager, options, ordering, parameters, parameterSubstitutionNumber, parameterSubtitutionMap, parentCompiler, parser, queryMgr, result, symtbl, update, variables -
Constructor Summary
ConstructorsConstructorDescriptionJPQLCompiler(PersistenceNucleusContext nucCtx, ClassLoaderResolver clr, String from, Class candidateClass, Collection candidates, String filter, Imports imports, String ordering, String result, String grouping, String having, String params, String update) -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether names of symbols are case-sensitive (e.g JDOQL returns true, but JPQL returns false).Method to compile the query, and return the compiled results.Accessor for the query language name.protected booleanMethod to return if the supplied name is a keyword.private static booleanisMethodNameAggregate(String methodName) resolveClass(String className) Method to perform a lookup of the class name from the input name.booleanWhether we should accept implicit variables in the query.Methods inherited from class JavaQueryCompiler
compileCandidatesParametersVariables, compileFilter, compileFrom, compileGrouping, compileHaving, compileOrdering, compileResult, compileUpdate, getPrimaryClass, getType, getType, setLinkToParentQuery, setOption, swapCandidateAliasNodeName, swapSubqueryParameters
-
Constructor Details
-
JPQLCompiler
public JPQLCompiler(PersistenceNucleusContext nucCtx, ClassLoaderResolver clr, String from, Class candidateClass, Collection candidates, String filter, Imports imports, String ordering, String result, String grouping, String having, String params, String update)
-
-
Method Details
-
compile
Method to compile the query, and return the compiled results.- Specified by:
compilein classJavaQueryCompiler- Parameters:
parameters- the parameter map of values keyed by param namesubqueryMap- Map of subquery variables, keyed by the subquery name- Returns:
- The compiled query
-
resolveClass
Method to perform a lookup of the class name from the input name. Makes use of the query "imports" and the lookup to "entity name".- Specified by:
resolveClassin interfaceSymbolResolver- Overrides:
resolveClassin classJavaQueryCompiler- Parameters:
className- Name of the class- Returns:
- The class corresponding to this name
- Throws:
ClassNotResolvedException- thrown if not resolvable using imports or entity name
-
supportsImplicitVariables
public boolean supportsImplicitVariables()Description copied from interface:SymbolResolverWhether we should accept implicit variables in the query. JDOQL supports variables, yet JPQL doesn't. Also in JDOQL if the user supplies some explicit variables then it doesn't allow implicit variables.- Returns:
- Whether to support implicit variables
-
caseSensitiveSymbolNames
public boolean caseSensitiveSymbolNames()Description copied from interface:SymbolResolverWhether names of symbols are case-sensitive (e.g JDOQL returns true, but JPQL returns false).- Returns:
- Whether case sensitive
-
getLanguage
Accessor for the query language name.- Specified by:
getLanguagein classJavaQueryCompiler- Returns:
- Name of the query language.
-
isKeyword
Method to return if the supplied name is a keyword. Keywords can only appear at particular places in a query so we need to detect for valid queries.- Specified by:
isKeywordin classJavaQueryCompiler- Parameters:
name- The name- Returns:
- Whether it is a keyword
-
isMethodNameAggregate
-