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
public final class ViewDescriptor extends UniqueTupleDescriptor implements 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
Fields Modifier and Type Field Description private intcheckOptionprivate UUIDcompSchemaIdstatic intNO_CHECK_OPTIONprivate UUIDuuidprivate java.lang.StringviewNameprivate java.lang.StringviewText-
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
Constructors Constructor Description ViewDescriptor(DataDictionary dataDictionary, UUID viewID, java.lang.String viewName, java.lang.String viewText, int checkOption, UUID compSchemaId)Constructor for a ViewDescriptor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddrop(LanguageConnectionContext lcc, SchemaDescriptor sd, TableDescriptor td)Drop this descriptor, if not already done.private voiddrop(LanguageConnectionContext lcc, SchemaDescriptor sd, TableDescriptor td, int action)Drop this descriptor, if not already done, due to action.intgetCheckOptionType()Gets an identifier telling what type of check option is on this view.java.lang.StringgetClassType()Get the provider's type.UUIDgetCompSchemaId()Get the compilation type schema id when this view was first bound.DependableFindergetDependableFinder()Get an object which can be written to disk and which, when read from disk, will find or reconstruct this in-memory Dependable.java.lang.StringgetName()UUIDgetObjectID()Get the provider's UUIDjava.lang.StringgetObjectName()Return the name of this Provider.UUIDgetUUID()Gets the UUID of the view.java.lang.StringgetViewText()Gets the text of the view definition.booleanisValid()Check that all of the dependent's dependencies are valid.voidmakeInvalid(int action, LanguageConnectionContext lcc)Mark the dependent as invalid (due to at least one of its dependencies being invalid).voidprepareToInvalidate(Provider p, int action, LanguageConnectionContext lcc)Prepare to mark the dependent as invalid (due to at least one of its dependencies being invalid).voidsetUUID(UUID uuid)Sets the UUID of the view.voidsetViewName(java.lang.String name)Sets the name of the view.java.lang.StringtoString()Prints the contents of the ViewDescriptor-
Methods 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 Detail
-
checkOption
private final int checkOption
-
viewName
private java.lang.String viewName
-
viewText
private final java.lang.String viewText
-
uuid
private UUID uuid
-
compSchemaId
private final UUID compSchemaId
-
NO_CHECK_OPTION
public static final int NO_CHECK_OPTION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ViewDescriptor
public ViewDescriptor(DataDictionary dataDictionary, UUID viewID, java.lang.String viewName, java.lang.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 Detail
-
getUUID
public UUID getUUID()
Gets the UUID of the view.- Specified by:
getUUIDin classUniqueTupleDescriptor- Returns:
- The UUID of the view.
-
setUUID
public void setUUID(UUID uuid)
Sets the UUID of the view.- Parameters:
uuid- The UUID of the view.
-
getViewText
public java.lang.String getViewText()
Gets the text of the view definition.- Returns:
- A String containing the text of the CREATE VIEW statement that created the view
-
setViewName
public void setViewName(java.lang.String name)
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
public UUID getCompSchemaId()
Get the compilation type schema id when this view was first bound.- Returns:
- the schema UUID
-
getDependableFinder
public DependableFinder getDependableFinder()
Description copied from interface:DependableGet an object which can be written to disk and which, when read from disk, will find or reconstruct this in-memory Dependable.- Specified by:
getDependableFinderin interfaceDependable- Returns:
- the stored form of this provider
- See Also:
Dependable.getDependableFinder()
-
getObjectName
public java.lang.String getObjectName()
Return the name of this Provider. (Useful for errors.)- Specified by:
getObjectNamein interfaceDependable- Returns:
- String The name of this provider.
-
getObjectID
public UUID getObjectID()
Get the provider's UUID- Specified by:
getObjectIDin interfaceDependable- Returns:
- String The provider's UUID
-
getClassType
public java.lang.String getClassType()
Get the provider's type.- Specified by:
getClassTypein 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:
prepareToInvalidatein interfaceDependent- Parameters:
action- The action causing the invalidationp- the providerlcc- The LanguageConnectionContext- Throws:
StandardException- thrown if unable to make it invalid
-
makeInvalid
public void makeInvalid(int action, LanguageConnectionContext lcc) throws StandardExceptionMark the dependent as invalid (due to at least one of its dependencies being invalid).- Specified by:
makeInvalidin interfaceDependent- Parameters:
action- The action causing the invalidationlcc- The LanguageConnectionContext- Throws:
StandardException- thrown if unable to make it invalid
-
toString
public java.lang.String toString()
Prints the contents of the ViewDescriptor- Overrides:
toStringin classjava.lang.Object- Returns:
- The contents as a String
-
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
public java.lang.String getName()
-
-