Interface QueryGenerator
- 
- All Known Implementing Classes:
- QueryToSQLMapper
 
 public interface QueryGeneratorInterface for a generator of query statements.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbindParameter(String paramName, Class type)Method to bind the specified parameter to the defined type.voidbindVariable(String varName, org.datanucleus.metadata.AbstractClassMetaData cmd, SQLTable sqlTbl, JavaTypeMapping mapping)Method to bind the specified variable to the table and mapping.SQLExpressionbindVariable(UnboundExpression expr, Class type)Method to bind the specified unbound variable (as cross join).org.datanucleus.ClassLoaderResolvergetClassLoaderResolver()Accessor for the ClassLoader resolver to use when looking up classes.org.datanucleus.store.query.compiler.CompilationComponentgetCompilationComponent()Accessor for the current query component being compiled.org.datanucleus.ExecutionContextgetExecutionContext()Accessor for the ExecutionContext for this query.ObjectgetProperty(String name)Accessor for a property affecting the query compilation.StringgetQueryLanguage()Accessor for the query language that this query pertains to.ClassgetTypeOfVariable(String varName)Accessor for the type of a variable if already known (declared?).ObjectgetValueForExtension(String key)Accessor for the value of the specified query extension (or null if not defined).booleanhasExplicitJoins()Accessor for whether the query has explicit joins.booleanhasExtension(String key)Accessor for whether the query being generated has the specified extension.booleanprocessingOnClause()ClassresolveClass(String className)Convenience method to resolve a class name.voiduseParameterExpressionAsLiteral(SQLLiteral paramLiteral)Method to instruct the generator to convert the provided parameter expression to just be a literal using the value of the parameter (hence the statement cannot be precompilable since the value needs to be known).
 
- 
- 
- 
Method Detail- 
getQueryLanguageString getQueryLanguage() Accessor for the query language that this query pertains to. Can be used to decide how to handle the input.- Returns:
- The query language
 
 - 
getClassLoaderResolverorg.datanucleus.ClassLoaderResolver getClassLoaderResolver() Accessor for the ClassLoader resolver to use when looking up classes.- Returns:
- The classloader resolver
 
 - 
getExecutionContextorg.datanucleus.ExecutionContext getExecutionContext() Accessor for the ExecutionContext for this query.- Returns:
- ExecutionContext
 
 - 
getCompilationComponentorg.datanucleus.store.query.compiler.CompilationComponent getCompilationComponent() Accessor for the current query component being compiled.- Returns:
- Component being compiled (if any)
 
 - 
getPropertyObject getProperty(String name) Accessor for a property affecting the query compilation. This can be something like whether there is an OR in the filter, which can then impact on the type of SQL used.- Parameters:
- name- The property name
- Returns:
- Its value
 
 - 
useParameterExpressionAsLiteralvoid useParameterExpressionAsLiteral(SQLLiteral paramLiteral) Method to instruct the generator to convert the provided parameter expression to just be a literal using the value of the parameter (hence the statement cannot be precompilable since the value needs to be known).- Parameters:
- paramLiteral- The parameter expression
 
 - 
getTypeOfVariableClass getTypeOfVariable(String varName) Accessor for the type of a variable if already known (declared?).- Parameters:
- varName- Name of the variable
- Returns:
- The type if it is known
 
 - 
bindVariablevoid bindVariable(String varName, org.datanucleus.metadata.AbstractClassMetaData cmd, SQLTable sqlTbl, JavaTypeMapping mapping) Method to bind the specified variable to the table and mapping.- Parameters:
- varName- Variable name
- cmd- Metadata for this variable type
- sqlTbl- Table for this variable
- mapping- The mapping of this variable in the table
 
 - 
bindVariableSQLExpression bindVariable(UnboundExpression expr, Class type) Method to bind the specified unbound variable (as cross join).- Parameters:
- expr- Unbound expression
- type- The type to bind as
- Returns:
- The bound expression to use instead
 
 - 
hasExplicitJoinsboolean hasExplicitJoins() Accessor for whether the query has explicit joins. A JPQL query has explicit joins, whereas a JDOQL query has variables and hence implicit joins. If not then has implicit joins, meaning that they could potentially be rebound later if prematurely bound in a particular way.- Returns:
- Whether the query has explicit joins
 
 - 
processingOnClauseboolean processingOnClause() 
 - 
bindParametervoid bindParameter(String paramName, Class type) Method to bind the specified parameter to the defined type. If the parameter is already bound (declared in the query perhaps, or bound via an earlier usage) then does nothing.- Parameters:
- paramName- Name of the parameter
- type- The type (or subclass)
 
 - 
resolveClassClass resolveClass(String className) Convenience method to resolve a class name.- Parameters:
- className- The class name
- Returns:
- The class it relates to (if found)
 
 - 
hasExtensionboolean hasExtension(String key) Accessor for whether the query being generated has the specified extension.- Parameters:
- key- Extension name
- Returns:
- Whether it is present
 
 
- 
 
-