| java.lang.Object org.apache.derby.iapi.sql.dictionary.TupleDescriptor org.apache.derby.iapi.sql.dictionary.SPSDescriptor
SPSDescriptor | public class SPSDescriptor extends TupleDescriptor implements UniqueSQLObjectDescriptor,Dependent,Provider(Code) | | A SPSDescriptor describes a Stored Prepared Statement.
It correlates to a row in SYS.SYSSTATEMENTS.
SYNCHRONIZATION: Stored prepared statements
may be cached. Thus they may be shared by multiple
threads. It is very hard for two threads to try
to muck with an sps simultaeously because all ddl
(including sps recompilation) clears out the sps
cache and invalidates whatever statement held a
cached sps. But it is possible for two statements
to do a prepare execute statment at the exact
same time, so both try to do an sps.prepare() at the
same time during code generation, so we synchronize
most everything except getters on immutable objects
just to be on the safe side.
author: jamie |
Constructor Summary | |
public | SPSDescriptor(DataDictionary dataDictionary, String name, UUID uuid, UUID suuid, UUID compSchemaUUID, char type, boolean valid, String text, boolean initiallyCompilable) | public | SPSDescriptor(DataDictionary dataDictionary, String name, UUID uuid, UUID suuid, UUID compSchemaUUID, char type, boolean valid, String text, String usingText, Timestamp compileTime, ExecPreparedStatement preparedStatement, boolean initiallyCompilable) Constructor for a SPS Descriptor. |
SPS_TYPE_EXPLAIN | final public static char SPS_TYPE_EXPLAIN(Code) | | |
SPS_TYPE_REGULAR | final public static char SPS_TYPE_REGULAR(Code) | | |
SPS_TYPE_TRIGGER | final public static char SPS_TYPE_TRIGGER(Code) | | Statement types.
- SPS_TYPE_TRIGGER - trigger (NOT IMPLEMENTED)
- SPS_TYPE_EXPLAIN - explain (NOT IMPLEMENTED)
- SPS_TYPE_REGULAR - catchall
|
SPSDescriptor | public SPSDescriptor(DataDictionary dataDictionary, String name, UUID uuid, UUID suuid, UUID compSchemaUUID, char type, boolean valid, String text, boolean initiallyCompilable) throws StandardException(Code) | | Constructor for a SPS Descriptor
Parameters: dataDictionary - The data dictionary that this descriptor lives in Parameters: name - the SPS name Parameters: uuid - the UUID Parameters: suuid - the schema UUID Parameters: compSchemaUUID - the schema UUID at compilation time Parameters: type - type Parameters: valid - is the sps valid Parameters: text - the text for this statement Parameters: initiallyCompilable - is the statement initially compilable? exception: StandardException - on error |
SPSDescriptor | public SPSDescriptor(DataDictionary dataDictionary, String name, UUID uuid, UUID suuid, UUID compSchemaUUID, char type, boolean valid, String text, String usingText, Timestamp compileTime, ExecPreparedStatement preparedStatement, boolean initiallyCompilable) throws StandardException(Code) | | Constructor for a SPS Descriptor. Used when
constructing an SPS descriptor from a row
in SYSSTATEMENTS.
Parameters: dataDictionary - The data dictionary that this descriptor lives in Parameters: name - the SPS name Parameters: uuid - the UUID Parameters: suuid - the schema UUID Parameters: compSchemaUUID - the schema UUID at compilation time Parameters: type - type Parameters: valid - is the sps valid Parameters: text - the text for this statement Parameters: usingText - the text for the USING clause supplied toCREATE or ALTER STATEMENT Parameters: compileTime - the time this was compiled Parameters: preparedStatement - the PreparedStatement Parameters: initiallyCompilable - is the statement initially compilable? exception: StandardException - on error |
getClassType | final public String getClassType()(Code) | | Get the provider's type.
String The provider's type. |
getCompSchemaId | final public UUID getCompSchemaId()(Code) | | Get the compilation type schema id when this view
was first bound.
the schema UUID |
getCompileTime | final public synchronized Timestamp getCompileTime()(Code) | | The time this prepared statement was compiled
the time this class was last compiled |
getName | final public String getName()(Code) | | Gets the name of the sps.
A String containing the name of the statement. |
getObjectID | final public UUID getObjectID()(Code) | | Get the provider's UUID
String The provider's UUID |
getObjectName | final public String getObjectName()(Code) | | Return the name of this Provider. (Useful for errors.)
String The name of this provider. |
getParameterDefaults | final public synchronized Object[] getParameterDefaults() throws StandardException(Code) | | Get the default parameter values for this
statement. Default parameter values are
supplied by a USING clause on either a
CREATE or ALTER STATEMENT statement.
the default parameter values exception: StandardException - on error |
getParams | final public synchronized DataTypeDescriptor[] getParams() throws StandardException(Code) | | Get the array of date type descriptors for
this statement. Currently, we do a lookup
if we don't already have the parameters saved.
When SPSes are cached, the parameters should
be set up when the sps is constructed.
the array of data type descriptors exception: StandardException - on error |
getPreparedStatement | final public synchronized ExecPreparedStatement getPreparedStatement(boolean recompIfInvalid) throws StandardException(Code) | | Get the preparedStatement for this statement.
Expects the prepared statement to have already
been added to SYS.SYSSTATEMENTS.
Side Effects: will update SYS.SYSSTATEMENTS with
the new plan if it needs to be recompiled.
Parameters: recompIfInvalid - if false, never recompile evenif statement is invalid the preparedStatement exception: StandardException - on error |
getQualifiedName | final public String getQualifiedName()(Code) | | Gets the full, qualified name of the statement.
A String containing the name of the statement. |
getSchemaDescriptor | final public SchemaDescriptor getSchemaDescriptor()(Code) | | Gets the SchemaDescriptor for this SPS Descriptor.
SchemaDescriptor The SchemaDescriptor. |
getText | final public String getText()(Code) | | Get the text used to create this statement.
Returns original text in a cleartext string.
The text |
getType | final public char getType()(Code) | | Gets an identifier telling what type of table this is.
Types match final ints in this interface. Currently
returns SPS_TYPE_REGULAR or SPS_TYPE_TRIGGER.
An identifier telling what type of statementwe are. |
getTypeAsString | final public String getTypeAsString()(Code) | | Simple little helper function to convert your type
to a string, which is easier to use.
type as a string |
getUUID | final public UUID getUUID()(Code) | | Gets the UUID of the SPS.
the uuid |
getUsingText | final public synchronized String getUsingText()(Code) | | Get the text of the USING clause used on CREATE
or ALTER statement.
The text |
initiallyCompilable | public boolean initiallyCompilable()(Code) | | Is the statement initially compilable?
false if statement was created with the NOCOMPILE flagtrue otherwise |
isValid | final public synchronized boolean isValid()(Code) | | Check that all of the dependent's dependencies are valid.
true if the dependent is currently valid |
loadGeneratedClass | public void loadGeneratedClass() throws StandardException(Code) | | Load the underlying generatd class. This is not expected
to be used outside of the datadictionary package. It
is used for optimizing class loading for sps
cacheing.
exception: StandardException - on error |
makeInvalid | final public synchronized void makeInvalid(int action, LanguageConnectionContext lcc) throws StandardException(Code) | | Mark the dependent as invalid (due to at least one of
its dependencies being invalid).
Parameters: action - The action causing the invalidation exception: StandardException - thrown if unable to make it invalid |
makeValid | final public synchronized void makeValid(LanguageConnectionContext lcc) throws StandardException(Code) | | Attempt to revalidate the dependent. For prepared statements,
this could go through its dependencies and check that they
are up to date; if not, it would recompile the statement.
Any failure during this attempt should throw
StandardException.unableToRevalidate().
exception: StandardException - thrown if unable to make it valid |
prepareAndRelease | final public synchronized void prepareAndRelease(LanguageConnectionContext lcc, TableDescriptor triggerTable, TransactionController tc) throws StandardException(Code) | | FOR TRIGGERS ONLY
Generate the class for this SPS and immediately
release it. This is useful for cases where we
don't want to immediately execute the statement
corresponding to this sps (e.g. CREATE STATEMENT).
SIDE EFFECTS: will update and SYSDEPENDS
with the prepared statement dependency info.
Parameters: lcc - the language connection context Parameters: triggerTable - the table descriptor to bind against. Hadbetter be null if this isn't a trigger sps. Parameters: tc - the transaction controller exception: StandardException - on error |
prepareAndRelease | final public synchronized void prepareAndRelease(LanguageConnectionContext lcc, TableDescriptor triggerTable) throws StandardException(Code) | | FOR TRIGGERS ONLY
Generate the class for this SPS and immediately
release it. This is useful for cases where we
don't want to immediately execute the statement
corresponding to this sps (e.g. CREATE STATEMENT).
SIDE EFFECTS: will update and SYSDEPENDS
with the prepared statement dependency info.
Parameters: lcc - the language connection context Parameters: triggerTable - the table descriptor to bind against. Hadbetter be null if this isn't a trigger sps. exception: StandardException - on error |
prepareAndRelease | final public synchronized void prepareAndRelease(LanguageConnectionContext lcc) throws StandardException(Code) | | Generate the class for this SPS and immediately
release it. This is useful for cases where we
don't want to immediately execute the statement
corresponding to this sps (e.g. CREATE STATEMENT).
SIDE EFFECTS: will update and SYSDEPENDS
with the prepared statement dependency info.
Parameters: lcc - the language connection context exception: StandardException - on error |
prepareToInvalidate | final public synchronized void prepareToInvalidate(Provider p, int action, LanguageConnectionContext lcc) throws StandardException(Code) | | Prepare to mark the dependent as invalid (due to at least one of
its dependencies being invalid).
Parameters: action - The action causing the invalidation Parameters: p - the provider exception: StandardException - thrown if unable to make it invalid |
setCompileTime | final public synchronized void setCompileTime()(Code) | | Set the compile time to now
|
setParameterDefaults | final public synchronized void setParameterDefaults(Object[] values)(Code) | | Set the parameter defaults for this statement.
Parameters: values - the parameter defaults |
setParams | final public synchronized void setParams(DataTypeDescriptor params)(Code) | | Set the list of parameters for this statement
Parameters: params - the parameter list |
setUUID | final public synchronized void setUUID(UUID uuid)(Code) | | Sets the UUID of the SPS.
Parameters: uuid - The UUID of the SPS to be set in the descriptor |
toString | final public String toString()(Code) | | Prints the contents of the TableDescriptor
The contents as a String |
validType | final public static boolean validType(char type)(Code) | | Validate the type. NOTE: Only SPS_TYPE_REGULAR
and SPS_TYPE_TRIGGER are currently valid.
Parameters: type - the type true/false |
|
|