Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.iapi.sql.compile
Interface CompilerContext  view CompilerContext download CompilerContext.java

All Superinterfaces:
org.apache.derby.iapi.services.context.Context

public interface CompilerContext
extends org.apache.derby.iapi.services.context.Context

CompilerContext stores the parser and type id factory to be used by the compiler. Stack compiler contexts when a new, local parser is needed (if calling the compiler recursively from within the compiler, for example).


Field Summary
static int CHECK_CONSTRAINT
           
static int COLUMN_REFERENCE_ILLEGAL
           
static java.lang.String CONTEXT_ID
          this is the ID we expect compiler contexts to be stored into a context manager under.
static int CURRENT_CONNECTION_ILLEGAL
           
static int DATETIME_ILLEGAL
           
static int DEFAULT_RESTRICTION
           
static int DIAGNOSTICS_ILLEGAL
           
static int FUNCTION_CALL_ILLEGAL
           
static int IGNORE_MISSING_CLASSES
           
static int INTERNAL_SQL_ILLEGAL
           
static int INTERNAL_SQL_LEGAL
          Any SQL we support is legal
static int SCHEMA_ILLEGAL
           
static int SQL_LEGAL
          Standard SQL is legal
static int SUBQUERY_ILLEGAL
           
static int UNNAMED_PARAMETER_ILLEGAL
           
static int USER_ILLEGAL
           
 
Method Summary
 int addSavedObject(java.lang.Object o)
          Add an object to the pool that is created at compile time and used at execution time.
 void addWarning(java.sql.SQLWarning warning)
          Add a compile time warning.
 void createDependency(org.apache.derby.iapi.sql.depend.Dependent d, org.apache.derby.iapi.sql.depend.Provider p)
          Add a dependency between two objects.
 void createDependency(org.apache.derby.iapi.sql.depend.Provider p)
          Add a dependency for the current dependent.
 void firstOnStack()
          Mark this CompilerContext as the first on the stack, so we can avoid continually popping and pushing a CompilerContext.
 org.apache.derby.iapi.services.loader.ClassFactory getClassFactory()
          Return the class factory to use in this compilation.
 org.apache.derby.iapi.sql.dictionary.SchemaDescriptor getCompilationSchema()
          Get the compilation schema descriptor for this compilation context.
 org.apache.derby.iapi.sql.depend.ProviderList getCurrentAuxiliaryProviderList()
          Get the current auxiliary provider list from this CompilerContext.
 org.apache.derby.iapi.sql.depend.Dependent getCurrentDependent()
          Get the current dependent from this CompilerContext.
 java.lang.Object getCursorInfo()
          Get the cursor info stored in the context.
 int getEntryIsolationLevel()
          Get the entry isolation level from this CC.
 boolean getInUse()
          Return the in use state for the compiler context.
 org.apache.derby.iapi.services.compiler.JavaFactory getJavaFactory()
          Get the JavaFactory from this CompilerContext.
 int getNextColumnNumber()
          Get the current next column number (for generated column names) from this CompilerContext.
 int getNextEquivalenceClass()
          Get the next equivalence class for equijoin clauses.
 int getNextParameterNumber()
          Get the next parameter number.
 int getNextResultSetNumber()
          Get the current next ResultSet number from this CompilerContext.
 int getNextSubqueryNumber()
          Get the current next subquery number from this CompilerContext.
 int getNextTableNumber()
          Get the current next table number from this CompilerContext.
 NodeFactory getNodeFactory()
          Get the NodeFactory from this CompilerContext.
 int getNumResultSets()
          Get the number of Results in the current statement from this CompilerContext.
 int getNumSubquerys()
          Get the number of subquerys in the current statement from this CompilerContext.
 int getNumTables()
          Get the number of tables in the current statement from this CompilerContext.
 java.util.Vector getParameterList()
          Get the parameter list.
 org.apache.derby.iapi.types.DataTypeDescriptor[] getParameterTypes()
          Get the array of DataTypeDescriptor representing the types of the ? parameters.
 org.apache.derby.iapi.sql.ParameterValueSet getParams()
          Get the params stored vai setParams.
 Parser getParser()
          Get the Parser from this CompilerContext.
 int getReliability()
          Return the reliability requirements of this clause.
 boolean getReturnParameterFlag()
          Is the callable statement uses ? for return parameter.
 java.lang.Object[] getSavedObjects()
          Get the saved object pool (for putting into the prepared statement).
 int getScanIsolationLevel()
          Get the isolation level for the scans in this query.
 org.apache.derby.iapi.store.access.SortCostController getSortCostController()
          Get a SortCostController.
 org.apache.derby.iapi.store.access.StoreCostController getStoreCostController(long conglomerateNumber, org.apache.derby.iapi.sql.conn.LanguageConnectionContext lcc)
          Get a StoreCostController for the given conglomerate.
 TypeCompilerFactory getTypeCompilerFactory()
          Get the TypeCompilerFactory from this CompilerContext.
 java.lang.String getUniqueClassName()
          Get a unique Class name from this CompilerContext.
 java.sql.SQLWarning getWarnings()
          Get the chain of compile time warnings.
 boolean isFirstOnStack()
          Is this the first CompilerContext on the stack?
 void resetContext()
          Reset compiler context (as for instance, when we recycle a context for use by another compilation.
 void resetNextResultSetNumber()
          Reset the next ResultSet number from this CompilerContext.
 org.apache.derby.iapi.sql.dictionary.SchemaDescriptor setCompilationSchema(org.apache.derby.iapi.sql.dictionary.SchemaDescriptor newDefault)
          Set the compilation schema descriptor for this compilation context.
 void setCurrentAuxiliaryProviderList(org.apache.derby.iapi.sql.depend.ProviderList apl)
          Set the current auxiliary provider list for this CompilerContext.
 void setCurrentDependent(org.apache.derby.iapi.sql.depend.Dependent d)
          Set the current dependent from this CompilerContext.
 void setCursorInfo(java.lang.Object cursorInfo)
          Set params
 void setEntryIsolationLevel(int isolationLevel)
          Set the isolation level on entry to this CC so that it can be restored on exit.
 void setInUse(boolean inUse)
          Set the in use state for the compiler context.
 void setParameterList(java.util.Vector parameterList)
          Set the parameter list.
 void setParams(org.apache.derby.iapi.sql.ParameterValueSet params)
          Set params
 void setReliability(int reliability)
          Sets which kind of query fragments are NOT allowed.
 void setReturnParameterFlag()
          If callable statement uses ? = form
 void setSavedObjects(java.lang.Object[] objs)
          Set the saved object pool (for putting into the prepared statement).
 void setScanIsolationLevel(int isolationLevel)
          Set the isolation level for the scans in this query.
 
Methods inherited from interface org.apache.derby.iapi.services.context.Context
cleanupOnError, getContextManager, getIdName, isLastHandler, popMe, pushMe
 

Field Detail

CONTEXT_ID

public static final java.lang.String CONTEXT_ID
this is the ID we expect compiler contexts to be stored into a context manager under.

See Also:
Constant Field Values

DATETIME_ILLEGAL

public static final int DATETIME_ILLEGAL
See Also:
Constant Field Values

CURRENT_CONNECTION_ILLEGAL

public static final int CURRENT_CONNECTION_ILLEGAL
See Also:
Constant Field Values

FUNCTION_CALL_ILLEGAL

public static final int FUNCTION_CALL_ILLEGAL
See Also:
Constant Field Values

UNNAMED_PARAMETER_ILLEGAL

public static final int UNNAMED_PARAMETER_ILLEGAL
See Also:
Constant Field Values

DIAGNOSTICS_ILLEGAL

public static final int DIAGNOSTICS_ILLEGAL
See Also:
Constant Field Values

SUBQUERY_ILLEGAL

public static final int SUBQUERY_ILLEGAL
See Also:
Constant Field Values

USER_ILLEGAL

public static final int USER_ILLEGAL
See Also:
Constant Field Values

COLUMN_REFERENCE_ILLEGAL

public static final int COLUMN_REFERENCE_ILLEGAL
See Also:
Constant Field Values

IGNORE_MISSING_CLASSES

public static final int IGNORE_MISSING_CLASSES
See Also:
Constant Field Values

SCHEMA_ILLEGAL

public static final int SCHEMA_ILLEGAL
See Also:
Constant Field Values

INTERNAL_SQL_ILLEGAL

public static final int INTERNAL_SQL_ILLEGAL
See Also:
Constant Field Values

SQL_LEGAL

public static final int SQL_LEGAL
Standard SQL is legal

See Also:
Constant Field Values

INTERNAL_SQL_LEGAL

public static final int INTERNAL_SQL_LEGAL
Any SQL we support is legal

See Also:
Constant Field Values

CHECK_CONSTRAINT

public static final int CHECK_CONSTRAINT
See Also:
Constant Field Values

DEFAULT_RESTRICTION

public static final int DEFAULT_RESTRICTION
See Also:
Constant Field Values
Method Detail

getParser

public Parser getParser()
Get the Parser from this CompilerContext. *


getNodeFactory

public NodeFactory getNodeFactory()
Get the NodeFactory from this CompilerContext.


getTypeCompilerFactory

public TypeCompilerFactory getTypeCompilerFactory()
Get the TypeCompilerFactory from this CompilerContext.


getClassFactory

public org.apache.derby.iapi.services.loader.ClassFactory getClassFactory()
Return the class factory to use in this compilation.


getJavaFactory

public org.apache.derby.iapi.services.compiler.JavaFactory getJavaFactory()
Get the JavaFactory from this CompilerContext.


getNextColumnNumber

public int getNextColumnNumber()
Get the current next column number (for generated column names) from this CompilerContext.


resetContext

public void resetContext()
Reset compiler context (as for instance, when we recycle a context for use by another compilation.


getNextTableNumber

public int getNextTableNumber()
Get the current next table number from this CompilerContext.


getNumTables

public int getNumTables()
Get the number of tables in the current statement from this CompilerContext.


getNextSubqueryNumber

public int getNextSubqueryNumber()
Get the current next subquery number from this CompilerContext.


getNumSubquerys

public int getNumSubquerys()
Get the number of subquerys in the current statement from this CompilerContext.


getNextResultSetNumber

public int getNextResultSetNumber()
Get the current next ResultSet number from this CompilerContext.


resetNextResultSetNumber

public void resetNextResultSetNumber()
Reset the next ResultSet number from this CompilerContext.


getNumResultSets

public int getNumResultSets()
Get the number of Results in the current statement from this CompilerContext.


getUniqueClassName

public java.lang.String getUniqueClassName()
Get a unique Class name from this CompilerContext. Ensures it is globally unique for this JVM.


getCurrentDependent

public org.apache.derby.iapi.sql.depend.Dependent getCurrentDependent()
Get the current dependent from this CompilerContext.


setCurrentDependent

public void setCurrentDependent(org.apache.derby.iapi.sql.depend.Dependent d)
Set the current dependent from this CompilerContext. This should be called at the start of a compile to register who has the dependencies needed for the compilation.


getCurrentAuxiliaryProviderList

public org.apache.derby.iapi.sql.depend.ProviderList getCurrentAuxiliaryProviderList()
Get the current auxiliary provider list from this CompilerContext.


setCurrentAuxiliaryProviderList

public void setCurrentAuxiliaryProviderList(org.apache.derby.iapi.sql.depend.ProviderList apl)
Set the current auxiliary provider list for this CompilerContext.


createDependency

public void createDependency(org.apache.derby.iapi.sql.depend.Provider p)
                      throws org.apache.derby.iapi.error.StandardException
Add a dependency for the current dependent.


createDependency

public void createDependency(org.apache.derby.iapi.sql.depend.Dependent d,
                             org.apache.derby.iapi.sql.depend.Provider p)
                      throws org.apache.derby.iapi.error.StandardException
Add a dependency between two objects.


addSavedObject

public int addSavedObject(java.lang.Object o)
Add an object to the pool that is created at compile time and used at execution time. Use the integer to reference it in execution constructs. Execution code will have to generate:
	(#objectType) (this.getPreparedStatement().getSavedObject(#int))
  <\pre>


getSavedObjects

public java.lang.Object[] getSavedObjects()
Get the saved object pool (for putting into the prepared statement). This turns it into its storable form, an array of objects.


setSavedObjects

public void setSavedObjects(java.lang.Object[] objs)
Set the saved object pool (for putting into the prepared statement).


setInUse

public void setInUse(boolean inUse)
Set the in use state for the compiler context.


getInUse

public boolean getInUse()
Return the in use state for the compiler context.


firstOnStack

public void firstOnStack()
Mark this CompilerContext as the first on the stack, so we can avoid continually popping and pushing a CompilerContext.


isFirstOnStack

public boolean isFirstOnStack()
Is this the first CompilerContext on the stack?


setReliability

public void setReliability(int reliability)
Sets which kind of query fragments are NOT allowed. Basically, these are fragments which return unstable results. CHECK CONSTRAINTS and CREATE PUBLICATION want to forbid certain kinds of fragments.


getReliability

public int getReliability()
Return the reliability requirements of this clause. See setReliability() for a definition of clause reliability.


getCompilationSchema

public org.apache.derby.iapi.sql.dictionary.SchemaDescriptor getCompilationSchema()
Get the compilation schema descriptor for this compilation context. Will be null if no default schema lookups have occured. Ie. the statement is independent of the current schema.


setCompilationSchema

public org.apache.derby.iapi.sql.dictionary.SchemaDescriptor setCompilationSchema(org.apache.derby.iapi.sql.dictionary.SchemaDescriptor newDefault)
Set the compilation schema descriptor for this compilation context.


getStoreCostController

public org.apache.derby.iapi.store.access.StoreCostController getStoreCostController(long conglomerateNumber,
                                                                                     org.apache.derby.iapi.sql.conn.LanguageConnectionContext lcc)
                                                                              throws org.apache.derby.iapi.error.StandardException
Get a StoreCostController for the given conglomerate.


getSortCostController

public org.apache.derby.iapi.store.access.SortCostController getSortCostController()
                                                                            throws org.apache.derby.iapi.error.StandardException
Get a SortCostController.


setParameterList

public void setParameterList(java.util.Vector parameterList)
Set the parameter list.


getParameterList

public java.util.Vector getParameterList()
Get the parameter list.


setReturnParameterFlag

public void setReturnParameterFlag()
If callable statement uses ? = form


getReturnParameterFlag

public boolean getReturnParameterFlag()
Is the callable statement uses ? for return parameter.


getParameterTypes

public org.apache.derby.iapi.types.DataTypeDescriptor[] getParameterTypes()
Get the array of DataTypeDescriptor representing the types of the ? parameters.


getNextParameterNumber

public int getNextParameterNumber()
Get the next parameter number. Useful when generating "associated" parameters.


getParams

public org.apache.derby.iapi.sql.ParameterValueSet getParams()
Get the params stored vai setParams. WARNING: nulls out the params value before returning it, so a subsequent get will get a null.


setParams

public void setParams(org.apache.derby.iapi.sql.ParameterValueSet params)
Set params


getCursorInfo

public java.lang.Object getCursorInfo()
Get the cursor info stored in the context.


setCursorInfo

public void setCursorInfo(java.lang.Object cursorInfo)
Set params


setScanIsolationLevel

public void setScanIsolationLevel(int isolationLevel)
Set the isolation level for the scans in this query.


getScanIsolationLevel

public int getScanIsolationLevel()
Get the isolation level for the scans in this query.


setEntryIsolationLevel

public void setEntryIsolationLevel(int isolationLevel)
Set the isolation level on entry to this CC so that it can be restored on exit.


getEntryIsolationLevel

public int getEntryIsolationLevel()
Get the entry isolation level from this CC.


getNextEquivalenceClass

public int getNextEquivalenceClass()
Get the next equivalence class for equijoin clauses.


addWarning

public void addWarning(java.sql.SQLWarning warning)
Add a compile time warning.


getWarnings

public java.sql.SQLWarning getWarnings()
Get the chain of compile time warnings.