org.datanucleus.store.rdbms.query2
Interface QueryGenerator

All Known Implementing Classes:
QueryToSQLMapper

public interface QueryGenerator

Interface for a generator of query statements.


Method Summary
 org.datanucleus.ClassLoaderResolver getClassLoaderResolver()
          Accessor for the ClassLoader resolver to use when looking up classes.
 org.datanucleus.query.compiler.CompilationComponent getCompilationComponent()
          Accessor for the current query component being compiled.
 org.datanucleus.ObjectManager getObjectManager()
          Accessor for the ObjectManager for this query.
 java.lang.Object getProperty(java.lang.String name)
          Accessor for a property affecting the query compilation.
 java.lang.String getQueryLanguage()
          Accessor for the query language that this query pertains to.
 void 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).
 

Method Detail

getQueryLanguage

java.lang.String 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

getClassLoaderResolver

org.datanucleus.ClassLoaderResolver getClassLoaderResolver()
Accessor for the ClassLoader resolver to use when looking up classes.

Returns:
The classloader resolver

getObjectManager

org.datanucleus.ObjectManager getObjectManager()
Accessor for the ObjectManager for this query.

Returns:
ObjectManager

getCompilationComponent

org.datanucleus.query.compiler.CompilationComponent getCompilationComponent()
Accessor for the current query component being compiled.

Returns:
Component being compiled (if any)

getProperty

java.lang.Object getProperty(java.lang.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

useParameterExpressionAsLiteral

void 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


Copyright © 2009. All Rights Reserved.