Class ViewDescriptor
java.lang.Object
org.apache.derby.iapi.sql.dictionary.TupleDescriptor
org.apache.derby.iapi.sql.dictionary.UniqueTupleDescriptor
org.apache.derby.iapi.sql.dictionary.ViewDescriptor
- All Implemented Interfaces:
Dependable
,Dependent
,Provider
This is the implementation of ViewDescriptor. Users of View descriptors
should only use the following methods:
- getUUID
- setUUID
- getViewText
- setViewName
- getCheckOptionType
- getCompSchemaId
- Version:
- 0.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final UUID
static final int
private UUID
private String
private final String
Fields inherited from interface org.apache.derby.catalog.Dependable
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 Summary
ConstructorsConstructorDescriptionViewDescriptor
(DataDictionary dataDictionary, UUID viewID, String viewName, String viewText, int checkOption, UUID compSchemaId) Constructor for a ViewDescriptor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
drop
(LanguageConnectionContext lcc, SchemaDescriptor sd, TableDescriptor td) Drop this descriptor, if not already done.private void
drop
(LanguageConnectionContext lcc, SchemaDescriptor sd, TableDescriptor td, int action) Drop this descriptor, if not already done, due to action.int
Gets an identifier telling what type of check option is on this view.Get the provider's type.Get the compilation type schema id when this view was first bound.Get an object which can be written to disk and which, when read from disk, will find or reconstruct this in-memory Dependable.getName()
Get the provider's UUIDReturn the name of this Provider.getUUID()
Gets the UUID of the view.Gets the text of the view definition.boolean
isValid()
Check that all of the dependent's dependencies are valid.void
makeInvalid
(int action, LanguageConnectionContext lcc) Mark the dependent as invalid (due to at least one of its dependencies being invalid).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).void
Sets the UUID of the view.void
setViewName
(String name) Sets the name of the view.toString()
Prints the contents of the ViewDescriptorMethods inherited from class org.apache.derby.iapi.sql.dictionary.TupleDescriptor
getColumnDependableFinder, getDataDictionary, getDependableFinder, getDescriptorName, getDescriptorType, isPersistent, setDataDictionary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.derby.catalog.Dependable
isPersistent
-
Field Details
-
checkOption
private final int checkOption -
viewName
-
viewText
-
uuid
-
compSchemaId
-
NO_CHECK_OPTION
public static final int NO_CHECK_OPTION- See Also:
-
-
Constructor Details
-
ViewDescriptor
public ViewDescriptor(DataDictionary dataDictionary, UUID viewID, String viewName, String viewText, int checkOption, UUID compSchemaId) Constructor for a ViewDescriptor.- Parameters:
dataDictionary
- The data dictionary that this descriptor lives inviewID
- The UUID for the viewviewName
- The name of the viewviewText
- The text of the query expression from the view definition.checkOption
- int check option typecompSchemaId
- the schemaid to compile in
-
-
Method Details
-
getUUID
Gets the UUID of the view.- Specified by:
getUUID
in classUniqueTupleDescriptor
- Returns:
- The UUID of the view.
-
setUUID
Sets the UUID of the view.- Parameters:
uuid
- The UUID of the view.
-
getViewText
Gets the text of the view definition.- Returns:
- A String containing the text of the CREATE VIEW statement that created the view
-
setViewName
Sets the name of the view.- Parameters:
name
- The name of the view.
-
getCheckOptionType
public int getCheckOptionType()Gets an identifier telling what type of check option is on this view.- Returns:
- An identifier telling what type of check option is on the view.
-
getCompSchemaId
Get the compilation type schema id when this view was first bound.- Returns:
- the schema UUID
-
getDependableFinder
Description copied from interface:Dependable
Get an object which can be written to disk and which, when read from disk, will find or reconstruct this in-memory Dependable.- Specified by:
getDependableFinder
in interfaceDependable
- Returns:
- the stored form of this provider
- See Also:
-
getObjectName
Return the name of this Provider. (Useful for errors.)- Specified by:
getObjectName
in interfaceDependable
- Returns:
- String The name of this provider.
-
getObjectID
Get the provider's UUID- Specified by:
getObjectID
in interfaceDependable
- Returns:
- String The provider's UUID
-
getClassType
Get the provider's type.- Specified by:
getClassType
in interfaceDependable
- Returns:
- String The provider's type.
-
isValid
public boolean isValid()Check that all of the dependent's dependencies are valid. -
prepareToInvalidate
public void prepareToInvalidate(Provider p, int action, LanguageConnectionContext lcc) throws StandardException Prepare to mark the dependent as invalid (due to at least one of its dependencies being invalid).- Specified by:
prepareToInvalidate
in interfaceDependent
- Parameters:
p
- the provideraction
- The action causing the invalidationlcc
- The LanguageConnectionContext- Throws:
StandardException
- thrown if unable to make it invalid
-
makeInvalid
Mark the dependent as invalid (due to at least one of its dependencies being invalid).- Specified by:
makeInvalid
in interfaceDependent
- Parameters:
action
- The action causing the invalidationlcc
- The LanguageConnectionContext- Throws:
StandardException
- thrown if unable to make it invalid
-
toString
Prints the contents of the ViewDescriptor -
drop
public void drop(LanguageConnectionContext lcc, SchemaDescriptor sd, TableDescriptor td) throws StandardException Drop this descriptor, if not already done.- Parameters:
lcc
- current language connection contextsd
- schema descriptortd
- table descriptor for this view- Throws:
StandardException
- standard error policy
-
drop
private void drop(LanguageConnectionContext lcc, SchemaDescriptor sd, TableDescriptor td, int action) throws StandardException Drop this descriptor, if not already done, due to action. If action is notDependencyManager.DROP_VIEW
, the descriptor is dropped due to dropping some other object, e.g. a table column.- Parameters:
lcc
- current language connection contextsd
- schema descriptortd
- table descriptor for this viewaction
- action- Throws:
StandardException
- standard error policy
-
getName
-