Dependable
, Dependent
, Provider
public class SPSDescriptor extends UniqueSQLObjectDescriptor implements Dependent, Provider
Modifier and Type | Field | Description |
---|---|---|
private java.sql.Timestamp |
compileTime |
|
private UUID |
compSchemaId |
|
private boolean |
initiallyCompilable |
|
private static int |
INVALIDATE |
|
private boolean |
lookedUpParams |
|
private java.lang.String |
name |
|
private java.lang.Object[] |
paramDefaults |
Old code - never used.
|
private DataTypeDescriptor[] |
params |
|
private ExecPreparedStatement |
preparedStatement |
|
private static int |
RECOMPILE |
interface to this class is:
public void prepare() throws StandardException;
public void prepareAndRelease(LanguageConnectionContext lcc)
throws StandardException;
public void prepareAndRelease(...);
public String getQualifiedName();
public char getType();
public String getTypeAsString();
public boolean isValid();
public boolean initiallyCompilable();
public java.sql.Timestamp getCompileTime();
public void setCompileTime();
public String getText();
public String getUsingText();
public void setUsingText(String usingText);
public void setUUID(UUID uuid);
public DataTypeDescriptor[] getParams() throws StandardException;
public void setParams(DataTypeDescriptor[] params);
Object[] getParameterDefaults() throws StandardException;
void setParameterDefaults(Object[] values);
public UUID getCompSchemaId();
public ExecPreparedStatement getPreparedStatement()
throws StandardException;
public ExecPreparedStatement getPreparedStatement(boolean recompIfInvalid)
throws StandardException;
public void revalidate(LanguageConnectionContext lcc)
throws StandardException;
|
private SchemaDescriptor |
sd |
|
static char |
SPS_TYPE_EXPLAIN |
|
static char |
SPS_TYPE_REGULAR |
|
static char |
SPS_TYPE_TRIGGER |
Statement types.
|
private java.lang.String |
text |
|
private char |
type |
|
private java.lang.String |
usingText |
|
private UUID |
uuid |
|
private UUIDFactory |
uuidFactory |
|
private boolean |
valid |
ACTIVATION, ALIAS, COLUMNS_IN_TABLE, COLUMNS_PERMISSION, CONGLOMERATE, CONSTRAINT, DEFAULT, FILE, HEAP, INDEX, PERM, PREPARED_STATEMENT, ROLE_GRANT, ROUTINE_PERMISSION, SCHEMA, SEQUENCE, STORED_PREPARED_STATEMENT, TABLE, TABLE_PERMISSION, TRIGGER, VIEW
Constructor | Description |
---|---|
SPSDescriptor(DataDictionary dataDictionary,
java.lang.String name,
UUID uuid,
UUID suuid,
UUID compSchemaUUID,
char type,
boolean valid,
java.lang.String text,
boolean initiallyCompilable) |
Constructor for a SPS Descriptor
|
SPSDescriptor(DataDictionary dataDictionary,
java.lang.String name,
UUID uuid,
UUID suuid,
UUID compSchemaUUID,
char type,
boolean valid,
java.lang.String text,
java.lang.String usingText,
java.sql.Timestamp compileTime,
ExecPreparedStatement preparedStatement,
boolean initiallyCompilable) |
Constructor for a SPS Descriptor.
|
Modifier and Type | Method | Description |
---|---|---|
private void |
compileStatement(LanguageConnectionContext lcc,
TableDescriptor triggerTable,
TransactionController tc) |
Compiles this SPS.
|
java.lang.String |
getClassType() |
Get the provider's type.
|
java.sql.Timestamp |
getCompileTime() |
The time this prepared statement was compiled
|
UUID |
getCompSchemaId() |
Get the compilation type schema id when this view
was first bound.
|
private static ContextService |
getContextService() |
Privileged lookup of the ContextService.
|
DependableFinder |
getDependableFinder() |
Return the stored form of this provider
|
java.lang.String |
getDescriptorName() |
|
java.lang.String |
getDescriptorType() |
Each descriptor must identify itself with its type; i.e index, check
constraint whatever.
|
java.lang.String |
getName() |
Gets the name of the sps.
|
UUID |
getObjectID() |
Get the provider's UUID
|
java.lang.String |
getObjectName() |
Return the name of this Provider.
|
java.lang.Object[] |
getParameterDefaults() |
Get the default parameter values for this
statement.
|
DataTypeDescriptor[] |
getParams() |
Get the array of date type descriptors for
this statement.
|
ExecPreparedStatement |
getPreparedStatement() |
Get the preparedStatement for this statement.
|
ExecPreparedStatement |
getPreparedStatement(boolean recompIfInvalid) |
Get the preparedStatement for this statement.
|
java.lang.String |
getQualifiedName() |
Gets the full, qualified name of the statement.
|
SchemaDescriptor |
getSchemaDescriptor() |
Gets the SchemaDescriptor for this SPS Descriptor.
|
java.lang.String |
getText() |
Get the text used to create this statement.
|
char |
getType() |
Gets an identifier telling what type of table this is.
|
java.lang.String |
getTypeAsString() |
Simple little helper function to convert your type
to a string, which is easier to use.
|
java.lang.String |
getUsingText() |
Get the text of the USING clause used on CREATE
or ALTER statement.
|
UUID |
getUUID() |
Gets the UUID of the SPS.
|
boolean |
initiallyCompilable() |
Is the statement initially compilable?
|
boolean |
isValid() |
Check that all of the dependent's dependencies are valid.
|
void |
loadGeneratedClass() |
Load the underlying generatd class.
|
void |
makeInvalid(int action,
LanguageConnectionContext lcc) |
Mark the dependent as invalid (due to at least one of
its dependencies being invalid).
|
void |
prepareAndRelease(LanguageConnectionContext lcc) |
Generate the class for this SPS and immediately
release it.
|
void |
prepareAndRelease(LanguageConnectionContext lcc,
TableDescriptor triggerTable) |
FOR TRIGGERS ONLY
|
void |
prepareAndRelease(LanguageConnectionContext lcc,
TableDescriptor triggerTable,
TransactionController tc) |
FOR TRIGGERS ONLY
|
void |
prepareToInvalidate(Provider p,
int action,
LanguageConnectionContext lcc) |
Prepare to mark the dependent as invalid (due to at least one of
its dependencies being invalid).
|
private UUID |
recreateUUID(java.lang.String idString) |
Get the UUID for the given string
|
void |
revalidate(LanguageConnectionContext lcc) |
Invalidate and revalidate.
|
void |
setCompileTime() |
Set the compile time to now
|
void |
setParameterDefaults(java.lang.Object[] values) |
Set the parameter defaults for this statement.
|
void |
setParams(DataTypeDescriptor[] params) |
Set the list of parameters for this statement
|
void |
setText(java.lang.String newText) |
It is possible that when a trigger is invalidated, the generated trigger
action sql associated with it needs to be regenerated.
|
java.lang.String |
toString() |
Prints the contents of the TableDescriptor
|
private void |
updateSYSSTATEMENTS(LanguageConnectionContext lcc,
int mode,
TransactionController tc) |
|
static boolean |
validType(char type) |
Validate the type.
|
isPersistent
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getColumnDependableFinder, getDataDictionary, getDependableFinder, isPersistent, setDataDictionary
public static final char SPS_TYPE_TRIGGER
public static final char SPS_TYPE_REGULAR
public static final char SPS_TYPE_EXPLAIN
private static final int RECOMPILE
private static final int INVALIDATE
private final SchemaDescriptor sd
private final java.lang.String name
private final UUID compSchemaId
private final char type
private java.lang.String text
private final java.lang.String usingText
private final UUID uuid
private boolean valid
private ExecPreparedStatement preparedStatement
private DataTypeDescriptor[] params
private java.sql.Timestamp compileTime
private java.lang.Object[] paramDefaults
private final boolean initiallyCompilable
private boolean lookedUpParams
private UUIDFactory uuidFactory
public SPSDescriptor(DataDictionary dataDictionary, java.lang.String name, UUID uuid, UUID suuid, UUID compSchemaUUID, char type, boolean valid, java.lang.String text, boolean initiallyCompilable) throws StandardException
dataDictionary
- The data dictionary that this descriptor lives inname
- the SPS nameuuid
- the UUIDsuuid
- the schema UUIDcompSchemaUUID
- the schema UUID at compilation timetype
- typevalid
- is the sps validtext
- the text for this statementinitiallyCompilable
- is the statement initially compilable?StandardException
- on errorpublic SPSDescriptor(DataDictionary dataDictionary, java.lang.String name, UUID uuid, UUID suuid, UUID compSchemaUUID, char type, boolean valid, java.lang.String text, java.lang.String usingText, java.sql.Timestamp compileTime, ExecPreparedStatement preparedStatement, boolean initiallyCompilable) throws StandardException
dataDictionary
- The data dictionary that this descriptor lives inname
- the SPS nameuuid
- the UUIDsuuid
- the schema UUIDcompSchemaUUID
- the schema UUID at compilation timetype
- typevalid
- is the sps validtext
- the text for this statementusingText
- the text for the USING clause supplied to
CREATE or ALTER STATEMENTcompileTime
- the time this was compiledpreparedStatement
- the PreparedStatementinitiallyCompilable
- is the statement initially compilable?StandardException
- on errorpublic final void prepareAndRelease(LanguageConnectionContext lcc, TableDescriptor triggerTable, TransactionController tc) throws StandardException
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.
lcc
- the language connection contexttriggerTable
- the table descriptor to bind against. Had
better be null if this isn't a trigger sps.tc
- the transaction controllerStandardException
- on errorpublic final void prepareAndRelease(LanguageConnectionContext lcc, TableDescriptor triggerTable) throws StandardException
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.
lcc
- the language connection contexttriggerTable
- the table descriptor to bind against. Had
better be null if this isn't a trigger sps.StandardException
- on errorpublic final void prepareAndRelease(LanguageConnectionContext lcc) throws StandardException
SIDE EFFECTS: will update and SYSDEPENDS with the prepared statement dependency info.
lcc
- the language connection contextStandardException
- on errorprivate void compileStatement(LanguageConnectionContext lcc, TableDescriptor triggerTable, TransactionController tc) throws StandardException
Note: This SPS may still be marked as invalid after this method has completed, because an invalidation request may have been received while compiling.
lcc
- connectiontriggerTable
- subject table (may be null
)tc
- transaction controller to use (may be null
)StandardException
- if something failspublic final java.lang.String getName()
getName
in class UniqueSQLObjectDescriptor
public final java.lang.String getQualifiedName()
public final SchemaDescriptor getSchemaDescriptor()
getSchemaDescriptor
in class UniqueSQLObjectDescriptor
public final char getType()
public final java.lang.String getTypeAsString()
public boolean initiallyCompilable()
public static boolean validType(char type)
type
- the typepublic final java.sql.Timestamp getCompileTime()
public final void setCompileTime()
public final java.lang.String getText()
public final void setText(java.lang.String newText)
newText
- public final java.lang.String getUsingText()
public final UUID getUUID()
getUUID
in class UniqueTupleDescriptor
public final DataTypeDescriptor[] getParams() throws StandardException
StandardException
- on errorpublic final void setParams(DataTypeDescriptor[] params)
params
- the parameter listpublic final java.lang.Object[] getParameterDefaults() throws StandardException
StandardException
- on errorpublic final void setParameterDefaults(java.lang.Object[] values)
values
- the parameter defaultspublic final ExecPreparedStatement getPreparedStatement() throws StandardException
StandardException
- on errorpublic final ExecPreparedStatement getPreparedStatement(boolean recompIfInvalid) throws StandardException
Side Effects: will update SYS.SYSSTATEMENTS with the new plan if it needs to be recompiled.
recompIfInvalid
- if false, never recompile even
if statement is invalidStandardException
- on errorpublic final UUID getCompSchemaId()
public final java.lang.String toString()
toString
in class java.lang.Object
public final DependableFinder getDependableFinder()
getDependableFinder
in interface Dependable
Dependable.getDependableFinder()
public final java.lang.String getObjectName()
getObjectName
in interface Dependable
public final UUID getObjectID()
getObjectID
in interface Dependable
public final java.lang.String getClassType()
getClassType
in interface Dependable
public final boolean isValid()
public final void prepareToInvalidate(Provider p, int action, LanguageConnectionContext lcc) throws StandardException
prepareToInvalidate
in interface Dependent
action
- The action causing the invalidationp
- the providerlcc
- The LanguageConnectionContextStandardException
- thrown if unable to make it invalidpublic final void makeInvalid(int action, LanguageConnectionContext lcc) throws StandardException
makeInvalid
in interface Dependent
action
- The action causing the invalidationlcc
- The LanguageConnectionContextStandardException
- thrown if unable to make it invalidpublic final void revalidate(LanguageConnectionContext lcc) throws StandardException
StandardException
- on errorpublic void loadGeneratedClass() throws StandardException
StandardException
- on errorprivate void updateSYSSTATEMENTS(LanguageConnectionContext lcc, int mode, TransactionController tc) throws StandardException
StandardException
private UUID recreateUUID(java.lang.String idString)
idString
- the stringpublic java.lang.String getDescriptorType()
TupleDescriptor
getDescriptorType
in class TupleDescriptor
TupleDescriptor.getDescriptorType()
public java.lang.String getDescriptorName()
getDescriptorName
in class TupleDescriptor
TupleDescriptor.getDescriptorName()
private static ContextService getContextService()
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.