Class 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:
    1. getUUID
    2. setUUID
    3. getViewText
    4. setViewName
    5. getCheckOptionType
    6. getCompSchemaId
    Version:
    0.1
    • 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
    • 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 in
        viewID - The UUID for the view
        viewName - The name of the view
        viewText - The text of the query expression from the view definition.
        checkOption - int check option type
        compSchemaId - the schemaid to compile in
    • Method Detail

      • 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
      • getObjectName

        public java.lang.String getObjectName()
        Return the name of this Provider. (Useful for errors.)
        Specified by:
        getObjectName in interface Dependable
        Returns:
        String The name of this provider.
      • getObjectID

        public UUID getObjectID()
        Get the provider's UUID
        Specified by:
        getObjectID in interface Dependable
        Returns:
        String The provider's UUID
      • getClassType

        public java.lang.String getClassType()
        Get the provider's type.
        Specified by:
        getClassType in interface Dependable
        Returns:
        String The provider's type.
      • isValid

        public boolean isValid()
        Check that all of the dependent's dependencies are valid.
        Specified by:
        isValid in interface Dependent
        Returns:
        true if the dependent is currently valid
      • makeInvalid

        public void makeInvalid​(int action,
                                LanguageConnectionContext lcc)
                         throws StandardException
        Mark the dependent as invalid (due to at least one of its dependencies being invalid).
        Specified by:
        makeInvalid in interface Dependent
        Parameters:
        action - The action causing the invalidation
        lcc - The LanguageConnectionContext
        Throws:
        StandardException - thrown if unable to make it invalid
      • toString

        public java.lang.String toString()
        Prints the contents of the ViewDescriptor
        Overrides:
        toString in class java.lang.Object
        Returns:
        The contents as a String
      • 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 not DependencyManager.DROP_VIEW, the descriptor is dropped due to dropping some other object, e.g. a table column.
        Parameters:
        lcc - current language connection context
        sd - schema descriptor
        td - table descriptor for this view
        action - action
        Throws:
        StandardException - standard error policy
      • getName

        public java.lang.String getName()