|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.iapi.services.context.ContextImpl
org.apache.derby.impl.sql.compile.CompilerContextImpl
Fields inherited from class org.apache.derby.iapi.services.context.ContextImpl |
|
Fields inherited from interface org.apache.derby.iapi.sql.compile.CompilerContext |
CHECK_CONSTRAINT, COLUMN_REFERENCE_ILLEGAL, CONTEXT_ID, CURRENT_CONNECTION_ILLEGAL, DATETIME_ILLEGAL, DEFAULT_RESTRICTION, DIAGNOSTICS_ILLEGAL, FUNCTION_CALL_ILLEGAL, IGNORE_MISSING_CLASSES, INTERNAL_SQL_ILLEGAL, INTERNAL_SQL_LEGAL, SCHEMA_ILLEGAL, SQL_LEGAL, SUBQUERY_ILLEGAL, UNNAMED_PARAMETER_ILLEGAL, USER_ILLEGAL |
Constructor Summary | |
CompilerContextImpl(ContextManager cm,
LanguageConnectionFactory lcf,
TypeCompilerFactory typeCompilerFactory)
|
Method Summary | |
private void |
addProviderToAuxiliaryList(Provider p)
Add a Provider to the current AuxiliaryProviderList, if one exists. |
int |
addSavedObject(java.lang.Object obj)
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 |
cleanupOnError(java.lang.Throwable error)
Contexts will be passed errors that are caught by the outer system when they are serious enough to require corrective action. |
private void |
closeSortCostControllers()
|
private void |
closeStoreCostControllers()
|
void |
createDependency(Dependent d,
Provider p)
Add a dependency between two objects. |
void |
createDependency(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. |
ClassFactory |
getClassFactory()
Return the class factory to use in this compilation. |
SchemaDescriptor |
getCompilationSchema()
Get the compilation schema descriptor for this compilation context. |
ProviderList |
getCurrentAuxiliaryProviderList()
Get the current auxiliary provider list from this CompilerContext. |
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. |
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 for this context |
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. |
DataTypeDescriptor[] |
getParameterTypes()
Get the array of DataTypeDescriptor representing the types of the ? |
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 ? |
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. |
SortCostController |
getSortCostController()
Get a SortCostController. |
StoreCostController |
getStoreCostController(long conglomerateNumber,
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. |
SchemaDescriptor |
setCompilationSchema(SchemaDescriptor newDefault)
Set the compilation schema descriptor for this compilation context. |
void |
setCurrentAuxiliaryProviderList(ProviderList apl)
Set the current auxiliary provider list for this CompilerContext. |
void |
setCurrentDependent(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(ParameterValueSet params)
Set params |
void |
setReliability(int reliability)
Sets which kind of query fragments are NOT allowed. |
void |
setReturnParameterFlag()
If callable statement uses ? |
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 class org.apache.derby.iapi.services.context.ContextImpl |
appendErrorInfo, getContextManager, getIdName, isLastHandler, popMe, pushMe |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.derby.iapi.services.context.Context |
getContextManager, getIdName, isLastHandler, popMe, pushMe |
Field Detail |
private final Parser parser
private LanguageConnectionFactory lcf
private TypeCompilerFactory typeCompilerFactory
private Dependent currentDependent
private DependencyManager dmgr
private boolean firstOnStack
private boolean inUse
private int reliability
private int nextColumnNumber
private int nextTableNumber
private int nextSubqueryNumber
private int nextResultSetNumber
private int entryIsolationLevel
private int scanIsolationLevel
private int nextEquivalenceClass
private long nextClassName
private java.util.Vector savedObjects
private java.lang.String classPrefix
private ParameterValueSet params
private SchemaDescriptor compilationSchema
private ProviderList currentAPL
private boolean returnParameterFlag
private java.util.Vector storeCostControllers
private java.util.Vector storeCostConglomIds
private SortCostController sortCostController
private java.util.Vector parameterList
private DataTypeDescriptor[] parameterDescriptors
private java.lang.Object cursorInfo
private java.sql.SQLWarning warnings
Constructor Detail |
public CompilerContextImpl(ContextManager cm, LanguageConnectionFactory lcf, TypeCompilerFactory typeCompilerFactory)
Method Detail |
public void cleanupOnError(java.lang.Throwable error) throws StandardException
Context
Contexts must release all their resources before removing themselves from their context manager.
The context manager will "unwind" the contexts during cleanup in the reverse order they were placed on its global stack.
If error is an instance of StandardException then an implementation of this method may throw a new exception if and only if the new exception is an instance of StandardException that is more severe than the original error or the new exception is a not an instance of StandardException (e.g java.lang.NullPointerException).
cleanupOnError
in interface Context
StandardException
- thrown by makeInvalid() callpublic void resetContext()
resetContext
in interface CompilerContext
public Parser getParser()
CompilerContext
getParser
in interface CompilerContext
public NodeFactory getNodeFactory()
getNodeFactory
in interface CompilerContext
public int getNextColumnNumber()
CompilerContext
getNextColumnNumber
in interface CompilerContext
public int getNextTableNumber()
CompilerContext
getNextTableNumber
in interface CompilerContext
public int getNumTables()
CompilerContext
getNumTables
in interface CompilerContext
public int getNextSubqueryNumber()
getNextSubqueryNumber
in interface CompilerContext
public int getNumSubquerys()
getNumSubquerys
in interface CompilerContext
public int getNextResultSetNumber()
CompilerContext
getNextResultSetNumber
in interface CompilerContext
public void resetNextResultSetNumber()
CompilerContext
resetNextResultSetNumber
in interface CompilerContext
public int getNumResultSets()
CompilerContext
getNumResultSets
in interface CompilerContext
public java.lang.String getUniqueClassName()
CompilerContext
getUniqueClassName
in interface CompilerContext
public int getNextEquivalenceClass()
getNextEquivalenceClass
in interface CompilerContext
public ClassFactory getClassFactory()
CompilerContext
getClassFactory
in interface CompilerContext
public JavaFactory getJavaFactory()
CompilerContext
getJavaFactory
in interface CompilerContext
public Dependent getCurrentDependent()
CompilerContext
getCurrentDependent
in interface CompilerContext
public void setCurrentDependent(Dependent d)
CompilerContext
setCurrentDependent
in interface CompilerContext
d
- The Dependent currently being compiled.public ProviderList getCurrentAuxiliaryProviderList()
getCurrentAuxiliaryProviderList
in interface CompilerContext
public void setCurrentAuxiliaryProviderList(ProviderList apl)
setCurrentAuxiliaryProviderList
in interface CompilerContext
apl
- The new current AuxiliaryProviderList.
public void createDependency(Provider p) throws StandardException
CompilerContext
createDependency
in interface CompilerContext
p
- The Provider of the dependency.
StandardException
- thrown on failure.public void createDependency(Dependent d, Provider p) throws StandardException
createDependency
in interface CompilerContext
d
- The Dependent object.p
- The Provider of the dependency.
StandardException
- thrown on failure.private void addProviderToAuxiliaryList(Provider p) throws StandardException
p
- The Provider to add.
StandardException
- thrown on failure.public int addSavedObject(java.lang.Object obj)
CompilerContext
(#objectType) (this.getPreparedStatement().getSavedObject(#int)) <\pre>
addSavedObject
in interface CompilerContext
public java.lang.Object[] getSavedObjects()
CompilerContext
getSavedObjects
in interface CompilerContext
public void setSavedObjects(java.lang.Object[] objs)
CompilerContext
setSavedObjects
in interface CompilerContext
objs
- The new saved objectsCompilerContext.setSavedObjects(java.lang.Object[])
public void setParams(ParameterValueSet params)
CompilerContext
setParams
in interface CompilerContext
params
- the paramsCompilerContext.setParams(org.apache.derby.iapi.sql.ParameterValueSet)
public ParameterValueSet getParams()
CompilerContext
getParams
in interface CompilerContext
CompilerContext.getParams()
public void setCursorInfo(java.lang.Object cursorInfo)
CompilerContext
setCursorInfo
in interface CompilerContext
cursorInfo
- the cursor infoCompilerContext.setCursorInfo(java.lang.Object)
public java.lang.Object getCursorInfo()
CompilerContext
getCursorInfo
in interface CompilerContext
CompilerContext.getCursorInfo()
public void firstOnStack()
CompilerContext
firstOnStack
in interface CompilerContext
CompilerContext.firstOnStack()
public boolean isFirstOnStack()
CompilerContext
isFirstOnStack
in interface CompilerContext
CompilerContext.isFirstOnStack()
public void setInUse(boolean inUse)
setInUse
in interface CompilerContext
inUse
- The new inUse state for the compiler context.
public boolean getInUse()
getInUse
in interface CompilerContext
public void setReliability(int reliability)
setReliability
in interface CompilerContext
reliability
- bitmask of types of query fragments to be forbidden
see the reliability bitmasks in CompilerContext.javapublic int getReliability()
getReliability
in interface CompilerContext
public StoreCostController getStoreCostController(long conglomerateNumber, LanguageConnectionContext lcc) throws StandardException
CompilerContext
getStoreCostController
in interface CompilerContext
conglomerateNumber
- The conglomerate for which to get a
StoreCostController.lcc
- Current LanguageConnectionContext.
StandardException
- Thrown on errorCompilerContext.getStoreCostController(long, org.apache.derby.iapi.sql.conn.LanguageConnectionContext)
private void closeStoreCostControllers()
public SortCostController getSortCostController() throws StandardException
CompilerContext
getSortCostController
in interface CompilerContext
StandardException
- Thrown on errorCompilerContext.getSortCostController()
private void closeSortCostControllers()
StandardException
- Thrown on errorpublic SchemaDescriptor getCompilationSchema()
getCompilationSchema
in interface CompilerContext
public SchemaDescriptor setCompilationSchema(SchemaDescriptor newDefault)
setCompilationSchema
in interface CompilerContext
public void setParameterList(java.util.Vector parameterList)
CompilerContext
setParameterList
in interface CompilerContext
parameterList
- The parameter list.
CompilerContext.setParameterList(java.util.Vector)
public java.util.Vector getParameterList()
CompilerContext
getParameterList
in interface CompilerContext
CompilerContext.getParameterList()
public void setReturnParameterFlag()
CompilerContext
setReturnParameterFlag
in interface CompilerContext
CompilerContext.setReturnParameterFlag()
public boolean getReturnParameterFlag()
CompilerContext
getReturnParameterFlag
in interface CompilerContext
CompilerContext.getReturnParameterFlag()
public DataTypeDescriptor[] getParameterTypes()
CompilerContext
getParameterTypes
in interface CompilerContext
CompilerContext.getParameterTypes()
public int getNextParameterNumber()
CompilerContext
getNextParameterNumber
in interface CompilerContext
CompilerContext.getNextParameterNumber()
public void setScanIsolationLevel(int isolationLevel)
CompilerContext
setScanIsolationLevel
in interface CompilerContext
isolationLevel
- The isolation level to use.
CompilerContext.setScanIsolationLevel(int)
public int getScanIsolationLevel()
CompilerContext
getScanIsolationLevel
in interface CompilerContext
CompilerContext.getScanIsolationLevel()
public void setEntryIsolationLevel(int isolationLevel)
CompilerContext
setEntryIsolationLevel
in interface CompilerContext
isolationLevel
- The isolation level on entry.
CompilerContext.setEntryIsolationLevel(int)
public int getEntryIsolationLevel()
CompilerContext
getEntryIsolationLevel
in interface CompilerContext
CompilerContext.getScanIsolationLevel()
public TypeCompilerFactory getTypeCompilerFactory()
CompilerContext
getTypeCompilerFactory
in interface CompilerContext
CompilerContext.getTypeCompilerFactory()
public void addWarning(java.sql.SQLWarning warning)
addWarning
in interface CompilerContext
public java.sql.SQLWarning getWarnings()
getWarnings
in interface CompilerContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |