Class BaseObject

    • Field Detail

      • version

        protected final int version
      • migrations

        protected final java.util.List<Migration> migrations
    • Constructor Detail

      • BaseObject

        public BaseObject​(java.lang.String schemaName,
                          java.lang.String objectName,
                          DatabaseObjectType objectType,
                          int version)
        Public constructor
        Parameters:
        schemaName -
        objectName -
        objectType -
        version -
      • BaseObject

        public BaseObject​(java.lang.String schemaName,
                          java.lang.String objectName,
                          DatabaseObjectType objectType,
                          int version,
                          java.util.List<Migration> migrations)
        Public constructor
        Parameters:
        schemaName -
        objectName -
        objectType -
        version -
    • Method Detail

      • getVersion

        public int getVersion()
        Description copied from interface: IDatabaseObject
        Getter for the schema version number this object applies to
        Specified by:
        getVersion in interface IDatabaseObject
        Returns:
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getSchemaName

        public java.lang.String getSchemaName()
      • getObjectName

        public java.lang.String getObjectName()
      • getQualifiedName

        public java.lang.String getQualifiedName()
      • getTypeNameVersion

        public java.lang.String getTypeNameVersion()
        Description copied from interface: IDatabaseObject
        Get the qualified name for this object: objectType:objectName:objectVersion
        Specified by:
        getTypeNameVersion in interface IDatabaseObject
        Returns:
      • addTags

        public void addTags​(java.util.Map<java.lang.String,​java.lang.String> tags)
        Add the given tags to our tag map
        Parameters:
        tags -
      • addTag

        public void addTag​(java.lang.String tagName,
                           java.lang.String tagValue)
        Description copied from interface: IDatabaseObject
        Add the tag name/value to the tag map for this object
        Specified by:
        addTag in interface IDatabaseObject
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • addDependency

        public void addDependency​(IDatabaseObject obj)
        Add the given obj as a dependency of this (obj must be created before this, or dropped after this)
        Parameters:
        obj -
      • addDependencies

        public void addDependencies​(java.util.Collection<IDatabaseObject> obj)
        Add the given collection of dependencies to our set
        Specified by:
        addDependencies in interface IDatabaseObject
        Parameters:
        obj -
      • getName

        public java.lang.String getName()
        Return the unique name for this object
        Specified by:
        getName in interface IDatabaseObject
        Returns:
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • applyVersion

        public void applyVersion​(IDatabaseAdapter target,
                                 IVersionHistoryService vhs)
        Apply the change, but only if it has a newer version than we already have recorded in the database
        Specified by:
        applyVersion in interface IDatabaseObject
        Parameters:
        target -
        vhs - the service used to manage the version history table
      • getTags

        public java.util.Map<java.lang.String,​java.lang.String> getTags()
        Description copied from interface: IDatabaseObject
        Get the map of tags associated with this object. Used to find things in the PhysicalDataModel
        Specified by:
        getTags in interface IDatabaseObject
        Returns:
      • grantGroupPrivileges

        protected void grantGroupPrivileges​(IDatabaseAdapter target,
                                            java.util.Set<Privilege> group,
                                            java.lang.String toUser)
        Internal method which can be override by different object types which may need to call a different grant method on the adapter
        Parameters:
        target -
        group -
        toUser -
      • addPrivilege

        public void addPrivilege​(java.lang.String groupName,
                                 Privilege p)
        Add the privilege to the named privilege group
        Parameters:
        groupName -
        p -
      • visit

        public void visit​(java.util.function.Consumer<IDatabaseObject> c)
        Description copied from interface: IDatabaseObject
        Visit this object, calling the consumer for itself, or its children if any
        Specified by:
        visit in interface IDatabaseObject