Top Description Fields Constructors Methods
org.apache.derby.impl.sql.compile

public Class CompilerContextImpl

extends ContextImpl
implements CompilerContext
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.compile.CompilerContext, org.apache.derby.iapi.services.context.Context
Imports
java.sql.SQLWarning, java.util.ArrayList, .HashMap, .Iterator, .List, org.apache.derby.catalog.UUID, org.apache.derby.shared.common.error.ExceptionSeverity, .StandardException, org.apache.derby.iapi.services.compiler.JavaFactory, org.apache.derby.iapi.services.context.ContextImpl, .ContextManager, org.apache.derby.iapi.services.io.FormatableBitSet, org.apache.derby.iapi.services.loader.ClassFactory, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.compile.CompilerContext, .OptimizerFactory, .Parser, .Visitable, .VisitableFilter, .TypeCompilerFactory, org.apache.derby.iapi.sql.conn.Authorizer, .LanguageConnectionContext, .LanguageConnectionFactory, org.apache.derby.iapi.sql.depend.DependencyManager, .Dependent, .Provider, .ProviderList, org.apache.derby.iapi.sql.dictionary.AliasDescriptor, .ColumnDescriptor, .PermDescriptor, .PrivilegedSQLObject, .SchemaDescriptor, .SequenceDescriptor, .StatementColumnPermission, .StatementGenericPermission, .StatementPermission, .StatementRolePermission, .StatementRoutinePermission, .StatementSchemaPermission, .StatementTablePermission, .TableDescriptor, org.apache.derby.iapi.store.access.SortCostController, .StoreCostController, org.apache.derby.iapi.transaction.TransactionControl, org.apache.derby.iapi.types.DataTypeDescriptor

CompilerContextImpl, implementation of CompilerContext. CompilerContext and hence CompilerContextImpl objects are private to a LanguageConnectionContext.

Field Summary

Modifier and TypeField and Description
private String
private SchemaDescriptor
private ProviderList
private Dependent
private int
private Object
private ArrayList<SchemaDescriptor>
defaultSchemaStack

Saved execution time default schema, if we need to change it temporarily.

private DependencyManager
private boolean
private boolean
private final LanguageConnectionContext
private final LanguageConnectionFactory
private HashMap<String, int[]>
private long
private int
private int
private int
private int
private int
private DataTypeDescriptor[]
private List<ParameterNode>
private final Parser
private ArrayList<VisitableFilter>
private final ArrayList<Integer>
private HashMap<UUID, SequenceDescriptor>
private int
private HashMap<StatementTablePermission, StatementColumnPermission>
private HashMap<StatementRolePermission, StatementRolePermission>
private HashMap<UUID, Integer>
private HashMap<StatementSchemaPermission, StatementSchemaPermission>
private HashMap<StatementTablePermission, StatementTablePermission>
private HashMap<UUID, String>
private boolean
private List<Object>
private int
private static final int
private boolean
private SortCostController
private final HashMap<Long, StoreCostController>
storeCostControllers

Map that contains all store cost controllers opened in this compiler context.

private TypeCompilerFactory
private SQLWarning

Constructor Summary

AccessConstructor and Description
public
CompilerContextImpl(ContextManager cm, LanguageConnectionContext lcc, TypeCompilerFactory typeCompilerFactory)

This constructor creates and saves the parser using the language connection factory when the context is created (when the first statement comes in, likely).

Method Summary

Modifier and TypeMethod and Description
public void
addPrivilegeFilter(VisitableFilter vf)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.addPrivilegeFilter.

Add a filter for determining which QueryTreeNodes give rise to privilege checks at run time.

private void
addProviderToAuxiliaryList(Provider
The Provider to add.
p
)

Add a Provider to the current AuxiliaryProviderList, if one exists.

public void
addReferencedSequence(SequenceDescriptor sd)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.addReferencedSequence.

Add a sequence descriptor to the list of referenced sequences.

public void
addRequiredColumnPriv(ColumnDescriptor
The column whose privileges we're interested in.
column
)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.addRequiredColumnPriv.

Add a column privilege to the list of used column privileges.

public void
addRequiredRolePriv(String roleName, int privType)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.addRequiredRolePriv.

Add a required role privilege to the list privileges.

public void
addRequiredRoutinePriv(AliasDescriptor routine)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.addRequiredRoutinePriv.

Add a routine execute privilege to the list of used routine privileges.

public void
addRequiredSchemaPriv(String
Schema name of the object that is being accessed
schemaName
,
String
Requested authorizationId for new schema
aid
,
int
CREATE_SCHEMA_PRIV, MODIFY_SCHEMA_PRIV or DROP_SCHEMA_PRIV
privType
)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.addRequiredSchemaPriv.

Add a required schema privilege to the list privileges.

public void
addRequiredTablePriv(TableDescriptor table)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.addRequiredTablePriv.

Add a table or view privilege to the list of used table privileges.

public void
addRequiredUsagePriv(PrivilegedSQLObject usableObject)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.addRequiredUsagePriv.

Add a usage privilege to the list of required privileges.

public int
addSavedObject(Object
object to add to the pool of saved objects
obj
)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.addSavedObject.

Add an object to the pool that is created at compile time and used at execution time.

public void
public void
beginScope(String scopeName)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.beginScope.

Record that the compiler is entering a named scope.

public void
cleanupOnError(Throwable
The original error
error
)

Implements org.apache.derby.iapi.services.context.Context.cleanupOnError.

Contexts will be passed errors that are caught by the outer system when they are serious enough to require corrective action.

private void
private void
public void
createDependency(Provider
The Provider of the dependency.
p
)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.createDependency.

Add a dependency for the current dependent.

public void
createDependency(Dependent
The Dependent object.
d
,
Provider
The Provider of the dependency.
p
)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.createDependency.

Add a dependency between two objects.

public void
endScope(String scopeName)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.endScope.

Record that the compiler is exiting a named scope.

public void
firstOnStack()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.firstOnStack.

Mark this CompilerContext as the first on the stack, so we can avoid continually popping and pushing a CompilerContext.

public ClassFactory
getClassFactory()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getClassFactory.

Return the class factory to use in this compilation.

public SchemaDescriptor

Returns:

the compilation schema descirptor
getCompilationSchema
()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getCompilationSchema.

Get the compilation schema descriptor for this compilation context.

public ProviderList

Returns:

The current AuxiliaryProviderList.
getCurrentAuxiliaryProviderList
()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getCurrentAuxiliaryProviderList.

Get the current auxiliary provider list from this CompilerContext.

public Object
getCursorInfo()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getCursorInfo.

Get the cursor info stored in the context.

public boolean

Returns:

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

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getInUse.

Return the in use state for the compiler context.

public JavaFactory
getJavaFactory()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getJavaFactory.

Get the JavaFactory from this CompilerContext.

public int
getNextColumnNumber()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getNextColumnNumber.

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

public int

Returns:

The next equivalence class for equijoin clauses.
getNextEquivalenceClass
()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getNextEquivalenceClass.

Get the next equivalence class for equijoin clauses.

public int
getNextResultSetNumber()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getNextResultSetNumber.

Get the current next ResultSet number from this CompilerContext.

public int

Returns:

int The next subquery number for the current statement.
getNextSubqueryNumber
()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getNextSubqueryNumber.

Get the current next subquery number from this CompilerContext.

public int
getNextTableNumber()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getNextTableNumber.

Get the current next table number from this CompilerContext.

public int
getNumResultSets()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getNumResultSets.

Get the number of Results in the current statement from this CompilerContext.

public int

Returns:

int The number of subquerys in the current statement.
getNumSubquerys
()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getNumSubquerys.

Get the number of subquerys in the current statement from this CompilerContext.

public int
getNumTables()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getNumTables.

Get the number of tables in the current statement from this CompilerContext.

public OptimizerFactory

Returns:

The OptimizerFactory for this context.
getOptimizerFactory
()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getOptimizerFactory.

Get the OptimizerFactory for this context

public List<ParameterNode>
pack-priv DataTypeDescriptor[]
getParameterTypes()

Get an array of type descriptors for all the ?

public Parser
getParser()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getParser.

Get the Parser from this CompilerContext.

public int

Returns:

a bitmask of which types of query fragments are to be forbidden
getReliability
()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getReliability.

Return the reliability requirements of this clause.

public List<StatementPermission>
public boolean
public Object[]
getSavedObjects()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getSavedObjects.

Get the saved object pool (for putting into the prepared statement).

public int
getScanIsolationLevel()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getScanIsolationLevel.

Get the isolation level for the scans in this query.

public SortCostController
public StoreCostController
getStoreCostController(long
The conglomerate for which to get a StoreCostController.
conglomerateNumber
)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getStoreCostController.

Get a StoreCostController for the given conglomerate.

public TypeCompilerFactory
getTypeCompilerFactory()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getTypeCompilerFactory.

Get the TypeCompilerFactory from this CompilerContext.

public String
getUniqueClassName()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getUniqueClassName.

Get a unique Class name from this CompilerContext.

public SQLWarning
getWarnings()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.getWarnings.

Get the chain of compile time warnings.

private void
public boolean
isFirstOnStack()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.isFirstOnStack.

Is this the first CompilerContext on the stack?

public boolean
isReferenced(SequenceDescriptor sd)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.isReferenced.

Report whether the given sequence has been referenced already.

public boolean
passesPrivilegeFilters(Visitable visitable)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.passesPrivilegeFilters.

Return true if a QueryTreeNode passes all of the filters which determine whether the QueryTreeNode gives rise to run time privilege checks.

public void
popCompilationSchema()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.popCompilationSchema.

Pop the default schema to use when compiling.

public void
public void
pushCompilationSchema(SchemaDescriptor
schema to use
sd
)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.pushCompilationSchema.

Push a default schema to use when compiling.

public void
pushCurrentPrivType(int
One of the privilege types in org.apache.derby.iapi.sql.conn.Authorizer.
privType
)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.pushCurrentPrivType.

Sets the current privilege type context.

public void
removePrivilegeFilter(VisitableFilter vf)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.removePrivilegeFilter.

Remove a filter for determining which QueryTreeNodes give rise to privilege checks at run time.

public void
resetContext()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.resetContext.

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

public void
resetNextResultSetNumber()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.resetNextResultSetNumber.

Reset the next ResultSet number from this CompilerContext.

public int
scopeDepth(String scopeName)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.scopeDepth.

Get the current depth for the named scope.

public SchemaDescriptor

Returns:

the previous compilation schema descirptor
setCompilationSchema
(SchemaDescriptor
the compilation schema
newDefault
)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.setCompilationSchema.

Set the compilation schema descriptor for this compilation context.

public void
setCurrentAuxiliaryProviderList(ProviderList
The new current AuxiliaryProviderList.
apl
)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.setCurrentAuxiliaryProviderList.

Set the current auxiliary provider list for this CompilerContext.

public void
setCurrentDependent(Dependent
The Dependent currently being compiled.
d
)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.setCurrentDependent.

Set the current dependent from this CompilerContext.

public void
public void
setInUse(boolean
The new inUse state for the compiler context.
inUse
)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.setInUse.

Set the in use state for the compiler context.

public void
setParameterList(List<ParameterNode>
The parameter list.
parameterList
)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.setParameterList.

Set the parameter list.

public void
setReliability(int
bitmask of types of query fragments to be forbidden see the reliability bitmasks in CompilerContext.java
reliability
)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.setReliability.

Sets which kind of query fragments are NOT allowed.

public void
public void
setSavedObjects(List<Object>
The new saved objects
objs
)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.setSavedObjects.

Set the saved object pool (for putting into the prepared statement).

public void
setScanIsolationLevel(int
The isolation level to use.
isolationLevel
)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.setScanIsolationLevel.

Set the isolation level for the scans in this query.

public boolean
skippingTypePrivileges()

Implements org.apache.derby.iapi.sql.compile.CompilerContext.skippingTypePrivileges.

Return whether we are skipping USAGE privileges for user-defined types

public boolean
skipTypePrivileges(boolean skip)

Implements org.apache.derby.iapi.sql.compile.CompilerContext.skipTypePrivileges.

Set whether we should skip adding USAGE privileges for user-defined types

Inherited from org.apache.derby.iapi.services.context.ContextImpl:
appendErrorInfogetContextManagergetIdNameisLastHandlerpopMepushMe