Class Database

All Implemented Interfaces:
IAsset, ICatalog, IDatabase, IReferenceable, ISQL, AuditDetail, Serializable, Comparable<Reference>

@Generated("com.atlan.generators.ModelGeneratorV2") public class Database extends Asset implements IDatabase, ISQL, ICatalog, IAsset, IReferenceable
Instance of a (relational) database in Atlan.
See Also:
  • Field Details Link icon

  • Constructor Details Link icon

  • Method Details Link icon

    • trimToReference Link icon

      public Database trimToReference() throws InvalidRequestException
      Builds the minimal object necessary to create a relationship to a Database, from a potentially more-complete Database object.
      Overrides:
      trimToReference in class Asset
      Returns:
      the minimal object necessary to relate to the Database
      Throws:
      InvalidRequestException - if any of the minimal set of required properties for a Database relationship are not found in the initial object
    • select Link icon

      public static FluentSearch.FluentSearchBuilder<?,?> select(AtlanClient client)
      Start a fluent search that will return all Database assets. Additional conditions can be chained onto the returned search before any asset retrieval is attempted, ensuring all conditions are pushed-down for optimal retrieval. Only active (non-archived) Database assets will be included.
      Parameters:
      client - connectivity to the Atlan tenant from which to retrieve the assets
      Returns:
      a fluent search that includes all Database assets
    • select Link icon

      public static FluentSearch.FluentSearchBuilder<?,?> select(AtlanClient client, boolean includeArchived)
      Start a fluent search that will return all Database assets. Additional conditions can be chained onto the returned search before any asset retrieval is attempted, ensuring all conditions are pushed-down for optimal retrieval.
      Parameters:
      client - connectivity to the Atlan tenant from which to retrieve the assets
      includeArchived - when true, archived (soft-deleted) Databases will be included
      Returns:
      a fluent search that includes all Database assets
    • refByGuid Link icon

      public static Database refByGuid(String guid)
      Reference to a Database by GUID. Use this to create a relationship to this Database, where the relationship should be replaced.
      Parameters:
      guid - the GUID of the Database to reference
      Returns:
      reference to a Database that can be used for defining a relationship to a Database
    • refByGuid Link icon

      public static Database refByGuid(String guid, Reference.SaveSemantic semantic)
      Reference to a Database by GUID. Use this to create a relationship to this Database, where you want to further control how that relationship should be updated (i.e. replaced, appended, or removed).
      Parameters:
      guid - the GUID of the Database to reference
      semantic - how to save this relationship (replace all with this, append it, or remove it)
      Returns:
      reference to a Database that can be used for defining a relationship to a Database
    • refByQualifiedName Link icon

      public static Database refByQualifiedName(String qualifiedName)
      Reference to a Database by qualifiedName. Use this to create a relationship to this Database, where the relationship should be replaced.
      Parameters:
      qualifiedName - the qualifiedName of the Database to reference
      Returns:
      reference to a Database that can be used for defining a relationship to a Database
    • refByQualifiedName Link icon

      public static Database refByQualifiedName(String qualifiedName, Reference.SaveSemantic semantic)
      Reference to a Database by qualifiedName. Use this to create a relationship to this Database, where you want to further control how that relationship should be updated (i.e. replaced, appended, or removed).
      Parameters:
      qualifiedName - the qualifiedName of the Database to reference
      semantic - how to save this relationship (replace all with this, append it, or remove it)
      Returns:
      reference to a Database that can be used for defining a relationship to a Database
    • get Link icon

      public static Database get(AtlanClient client, String id) throws AtlanException
      Retrieves a Database by one of its identifiers, complete with all of its relationships.
      Parameters:
      client - connectivity to the Atlan tenant from which to retrieve the asset
      id - of the Database to retrieve, either its GUID or its full qualifiedName
      Returns:
      the requested full Database, complete with all of its relationships
      Throws:
      AtlanException - on any error during the API invocation, such as the NotFoundException if the Database does not exist or the provided GUID is not a Database
    • get Link icon

      public static Database get(AtlanClient client, String id, boolean includeAllRelationships) throws AtlanException
      Retrieves a Database by one of its identifiers, optionally complete with all of its relationships.
      Parameters:
      client - connectivity to the Atlan tenant from which to retrieve the asset
      id - of the Database to retrieve, either its GUID or its full qualifiedName
      includeAllRelationships - if true, all the asset's relationships will also be retrieved; if false, no relationships will be retrieved
      Returns:
      the requested full Database, optionally complete with all of its relationships
      Throws:
      AtlanException - on any error during the API invocation, such as the NotFoundException if the Database does not exist or the provided GUID is not a Database
    • get Link icon

      public static Database get(AtlanClient client, String id, Collection<AtlanField> attributes) throws AtlanException
      Retrieves a Database by one of its identifiers, with only the requested attributes (and relationships).
      Parameters:
      client - connectivity to the Atlan tenant from which to retrieve the asset
      id - of the Database to retrieve, either its GUID or its full qualifiedName
      attributes - to retrieve for the Database, including any relationships
      Returns:
      the requested Database, with only its minimal information and the requested attributes (and relationships)
      Throws:
      AtlanException - on any error during the API invocation, such as the NotFoundException if the Database does not exist or the provided GUID is not a Database
    • get Link icon

      public static Database get(AtlanClient client, String id, Collection<AtlanField> attributes, Collection<AtlanField> attributesOnRelated) throws AtlanException
      Retrieves a Database by one of its identifiers, with only the requested attributes (and relationships).
      Parameters:
      client - connectivity to the Atlan tenant from which to retrieve the asset
      id - of the Database to retrieve, either its GUID or its full qualifiedName
      attributes - to retrieve for the Database, including any relationships
      attributesOnRelated - to retrieve on each relationship retrieved for the Database
      Returns:
      the requested Database, with only its minimal information and the requested attributes (and relationships)
      Throws:
      AtlanException - on any error during the API invocation, such as the NotFoundException if the Database does not exist or the provided GUID is not a Database
    • restore Link icon

      public static boolean restore(AtlanClient client, String qualifiedName) throws AtlanException
      Restore the archived (soft-deleted) Database to active.
      Parameters:
      client - connectivity to the Atlan tenant on which to restore the asset
      qualifiedName - for the Database
      Returns:
      true if the Database is now active, and false otherwise
      Throws:
      AtlanException - on any API problems
    • creator Link icon

      public static Database.DatabaseBuilder<?,?> creator(String name, String connectionQualifiedName)
      Builds the minimal object necessary to create a database.
      Parameters:
      name - of the database
      connectionQualifiedName - unique name of the specific instance of the software / system that hosts the database
      Returns:
      the minimal request necessary to create the database, as a builder
    • generateQualifiedName Link icon

      public static String generateQualifiedName(String name, String connectionQualifiedName)
      Generate a unique database name.
      Parameters:
      name - of the database
      connectionQualifiedName - unique name of the specific instance of the software / system that hosts the database
      Returns:
      a unique name for the database
    • updater Link icon

      public static Database.DatabaseBuilder<?,?> updater(String qualifiedName, String name)
      Builds the minimal object necessary to update a Database.
      Parameters:
      qualifiedName - of the Database
      name - of the Database
      Returns:
      the minimal request necessary to update the Database, as a builder
    • trimToRequired Link icon

      public Database.DatabaseBuilder<?,?> trimToRequired() throws InvalidRequestException
      Builds the minimal object necessary to apply an update to a Database, from a potentially more-complete Database object.
      Overrides:
      trimToRequired in class Asset
      Returns:
      the minimal object necessary to update the Database, as a builder
      Throws:
      InvalidRequestException - if any of the minimal set of required properties for Database are not found in the initial object
    • removeDescription Link icon

      public static Database removeDescription(AtlanClient client, String qualifiedName, String name) throws AtlanException
      Remove the system description from a Database.
      Parameters:
      client - connectivity to the Atlan tenant on which to remove the asset's description
      qualifiedName - of the Database
      name - of the Database
      Returns:
      the updated Database, or null if the removal failed
      Throws:
      AtlanException - on any API problems
    • removeUserDescription Link icon

      public static Database removeUserDescription(AtlanClient client, String qualifiedName, String name) throws AtlanException
      Remove the user's description from a Database.
      Parameters:
      client - connectivity to the Atlan tenant on which to remove the asset's description
      qualifiedName - of the Database
      name - of the Database
      Returns:
      the updated Database, or null if the removal failed
      Throws:
      AtlanException - on any API problems
    • removeOwners Link icon

      public static Database removeOwners(AtlanClient client, String qualifiedName, String name) throws AtlanException
      Remove the owners from a Database.
      Parameters:
      client - connectivity to the Atlan tenant from which to remove the Database's owners
      qualifiedName - of the Database
      name - of the Database
      Returns:
      the updated Database, or null if the removal failed
      Throws:
      AtlanException - on any API problems
    • updateCertificate Link icon

      public static Database updateCertificate(AtlanClient client, String qualifiedName, CertificateStatus certificate, String message) throws AtlanException
      Update the certificate on a Database.
      Parameters:
      client - connectivity to the Atlan tenant on which to update the Database's certificate
      qualifiedName - of the Database
      certificate - to use
      message - (optional) message, or null if no message
      Returns:
      the updated Database, or null if the update failed
      Throws:
      AtlanException - on any API problems
    • removeCertificate Link icon

      public static Database removeCertificate(AtlanClient client, String qualifiedName, String name) throws AtlanException
      Remove the certificate from a Database.
      Parameters:
      client - connectivity to the Atlan tenant from which to remove the Database's certificate
      qualifiedName - of the Database
      name - of the Database
      Returns:
      the updated Database, or null if the removal failed
      Throws:
      AtlanException - on any API problems
    • updateAnnouncement Link icon

      public static Database updateAnnouncement(AtlanClient client, String qualifiedName, AtlanAnnouncementType type, String title, String message) throws AtlanException
      Update the announcement on a Database.
      Parameters:
      client - connectivity to the Atlan tenant on which to update the Database's announcement
      qualifiedName - of the Database
      type - type of announcement to set
      title - (optional) title of the announcement to set (or null for no title)
      message - (optional) message of the announcement to set (or null for no message)
      Returns:
      the result of the update, or null if the update failed
      Throws:
      AtlanException - on any API problems
    • removeAnnouncement Link icon

      public static Database removeAnnouncement(AtlanClient client, String qualifiedName, String name) throws AtlanException
      Remove the announcement from a Database.
      Parameters:
      client - connectivity to the Atlan client from which to remove the Database's announcement
      qualifiedName - of the Database
      name - of the Database
      Returns:
      the updated Database, or null if the removal failed
      Throws:
      AtlanException - on any API problems
    • replaceTerms Link icon

      public static Database replaceTerms(AtlanClient client, String qualifiedName, String name, List<IGlossaryTerm> terms) throws AtlanException
      Replace the terms linked to the Database.
      Parameters:
      client - connectivity to the Atlan tenant on which to replace the Database's assigned terms
      qualifiedName - for the Database
      name - human-readable name of the Database
      terms - the list of terms to replace on the Database, or null to remove all terms from the Database
      Returns:
      the Database that was updated (note that it will NOT contain details of the replaced terms)
      Throws:
      AtlanException - on any API problems
    • appendTerms Link icon

      @Deprecated public static Database appendTerms(AtlanClient client, String qualifiedName, List<IGlossaryTerm> terms) throws AtlanException
      Link additional terms to the Database, without replacing existing terms linked to the Database. Note: this operation must make two API calls — one to retrieve the Database's existing terms, and a second to append the new terms.
      Parameters:
      client - connectivity to the Atlan tenant on which to append terms to the Database
      qualifiedName - for the Database
      terms - the list of terms to append to the Database
      Returns:
      the Database that was updated (note that it will NOT contain details of the appended terms)
      Throws:
      AtlanException - on any API problems
    • removeTerms Link icon

      @Deprecated public static Database removeTerms(AtlanClient client, String qualifiedName, List<IGlossaryTerm> terms) throws AtlanException
      Remove terms from a Database, without replacing all existing terms linked to the Database. Note: this operation must make two API calls — one to retrieve the Database's existing terms, and a second to remove the provided terms.
      Parameters:
      client - connectivity to the Atlan tenant from which to remove terms from the Database
      qualifiedName - for the Database
      terms - the list of terms to remove from the Database, which must be referenced by GUID
      Returns:
      the Database that was updated (note that it will NOT contain details of the resulting terms)
      Throws:
      AtlanException - on any API problems
    • appendAtlanTags Link icon

      @Deprecated public static Database appendAtlanTags(AtlanClient client, String qualifiedName, List<String> atlanTagNames) throws AtlanException
      Add Atlan tags to a Database, without replacing existing Atlan tags linked to the Database. Note: this operation must make two API calls — one to retrieve the Database's existing Atlan tags, and a second to append the new Atlan tags.
      Parameters:
      client - connectivity to the Atlan tenant on which to append Atlan tags to the Database
      qualifiedName - of the Database
      atlanTagNames - human-readable names of the Atlan tags to add
      Returns:
      the updated Database
      Throws:
      AtlanException - on any API problems
    • appendAtlanTags Link icon

      @Deprecated public static Database appendAtlanTags(AtlanClient client, String qualifiedName, List<String> atlanTagNames, boolean propagate, boolean removePropagationsOnDelete, boolean restrictLineagePropagation) throws AtlanException
      Add Atlan tags to a Database, without replacing existing Atlan tags linked to the Database. Note: this operation must make two API calls — one to retrieve the Database's existing Atlan tags, and a second to append the new Atlan tags.
      Parameters:
      client - connectivity to the Atlan tenant on which to append Atlan tags to the Database
      qualifiedName - of the Database
      atlanTagNames - human-readable names of the Atlan tags to add
      propagate - whether to propagate the Atlan tag (true) or not (false)
      removePropagationsOnDelete - whether to remove the propagated Atlan tags when the Atlan tag is removed from this asset (true) or not (false)
      restrictLineagePropagation - whether to avoid propagating through lineage (true) or do propagate through lineage (false)
      Returns:
      the updated Database
      Throws:
      AtlanException - on any API problems
    • removeAtlanTag Link icon

      @Deprecated public static void removeAtlanTag(AtlanClient client, String qualifiedName, String atlanTagName) throws AtlanException
      Remove an Atlan tag from a Database.
      Parameters:
      client - connectivity to the Atlan tenant from which to remove an Atlan tag from a Database
      qualifiedName - of the Database
      atlanTagName - human-readable name of the Atlan tag to remove
      Throws:
      AtlanException - on any API problems, or if the Atlan tag does not exist on the Database
    • _internal Link icon

      public static Database.DatabaseBuilder<?,?> _internal()
    • toBuilder Link icon

      public Database.DatabaseBuilder<?,?> toBuilder()
      Overrides:
      toBuilder in class Reference
    • getCalculationViewName Link icon

      public String getCalculationViewName()
      Simple name of the calculation view in which this SQL asset exists, or empty if it does not exist within a calculation view.
      Specified by:
      getCalculationViewName in interface IDatabase
      Specified by:
      getCalculationViewName in interface ISQL
    • getCalculationViewQualifiedName Link icon

      public String getCalculationViewQualifiedName()
      Unique name of the calculation view in which this SQL asset exists, or empty if it does not exist within a calculation view.
      Specified by:
      getCalculationViewQualifiedName in interface IDatabase
      Specified by:
      getCalculationViewQualifiedName in interface ISQL
    • getDatabaseName Link icon

      public String getDatabaseName()
      Simple name of the database in which this SQL asset exists, or empty if it does not exist within a database.
      Specified by:
      getDatabaseName in interface IDatabase
      Specified by:
      getDatabaseName in interface ISQL
    • getDatabaseQualifiedName Link icon

      public String getDatabaseQualifiedName()
      Unique name of the database in which this SQL asset exists, or empty if it does not exist within a database.
      Specified by:
      getDatabaseQualifiedName in interface IDatabase
      Specified by:
      getDatabaseQualifiedName in interface ISQL
    • getDbtModels Link icon

      public SortedSet<IDbtModel> getDbtModels()
      (Deprecated) Model containing the assets.
      Specified by:
      getDbtModels in interface IDatabase
      Specified by:
      getDbtModels in interface ISQL
    • getDbtSeedAssets Link icon

      public SortedSet<IDbtSeed> getDbtSeedAssets()
      DBT seeds that materialize the SQL asset.
      Specified by:
      getDbtSeedAssets in interface IDatabase
      Specified by:
      getDbtSeedAssets in interface ISQL
    • getDbtSources Link icon

      public SortedSet<IDbtSource> getDbtSources()
      Source containing the assets.
      Specified by:
      getDbtSources in interface IDatabase
      Specified by:
      getDbtSources in interface ISQL
    • getDbtTests Link icon

      public SortedSet<IDbtTest> getDbtTests()
      Tests related to this asset.
      Specified by:
      getDbtTests in interface IDatabase
      Specified by:
      getDbtTests in interface ISQL
    • getInputToAirflowTasks Link icon

      public SortedSet<IAirflowTask> getInputToAirflowTasks()
      Tasks to which this asset provides input.
      Specified by:
      getInputToAirflowTasks in interface ICatalog
      Specified by:
      getInputToAirflowTasks in interface IDatabase
      Specified by:
      getInputToAirflowTasks in interface ISQL
    • getInputToProcesses Link icon

      public SortedSet<ILineageProcess> getInputToProcesses()
      Processes to which this asset provides input.
      Specified by:
      getInputToProcesses in interface ICatalog
      Specified by:
      getInputToProcesses in interface IDatabase
      Specified by:
      getInputToProcesses in interface ISQL
    • getInputToSparkJobs Link icon

      public SortedSet<ISparkJob> getInputToSparkJobs()
      TBC
      Specified by:
      getInputToSparkJobs in interface ICatalog
      Specified by:
      getInputToSparkJobs in interface IDatabase
      Specified by:
      getInputToSparkJobs in interface ISQL
    • getIsProfiled Link icon

      public Boolean getIsProfiled()
      Whether this asset has been profiled (true) or not (false).
      Specified by:
      getIsProfiled in interface IDatabase
      Specified by:
      getIsProfiled in interface ISQL
    • getLastProfiledAt Link icon

      public Long getLastProfiledAt()
      Time (epoch) at which this asset was last profiled, in milliseconds.
      Specified by:
      getLastProfiledAt in interface IDatabase
      Specified by:
      getLastProfiledAt in interface ISQL
    • getModelImplementedAttributes Link icon

      public SortedSet<IModelAttribute> getModelImplementedAttributes()
      Attributes implemented by this asset.
      Specified by:
      getModelImplementedAttributes in interface ICatalog
      Specified by:
      getModelImplementedAttributes in interface IDatabase
      Specified by:
      getModelImplementedAttributes in interface ISQL
    • getModelImplementedEntities Link icon

      public SortedSet<IModelEntity> getModelImplementedEntities()
      Entities implemented by this asset.
      Specified by:
      getModelImplementedEntities in interface ICatalog
      Specified by:
      getModelImplementedEntities in interface IDatabase
      Specified by:
      getModelImplementedEntities in interface ISQL
    • getOutputFromAirflowTasks Link icon

      public SortedSet<IAirflowTask> getOutputFromAirflowTasks()
      Tasks from which this asset is output.
      Specified by:
      getOutputFromAirflowTasks in interface ICatalog
      Specified by:
      getOutputFromAirflowTasks in interface IDatabase
      Specified by:
      getOutputFromAirflowTasks in interface ISQL
    • getOutputFromProcesses Link icon

      public SortedSet<ILineageProcess> getOutputFromProcesses()
      Processes from which this asset is produced as output.
      Specified by:
      getOutputFromProcesses in interface ICatalog
      Specified by:
      getOutputFromProcesses in interface IDatabase
      Specified by:
      getOutputFromProcesses in interface ISQL
    • getOutputFromSparkJobs Link icon

      public SortedSet<ISparkJob> getOutputFromSparkJobs()
      TBC
      Specified by:
      getOutputFromSparkJobs in interface ICatalog
      Specified by:
      getOutputFromSparkJobs in interface IDatabase
      Specified by:
      getOutputFromSparkJobs in interface ISQL
    • getQueryCount Link icon

      public Long getQueryCount()
      Number of times this asset has been queried.
      Specified by:
      getQueryCount in interface IDatabase
      Specified by:
      getQueryCount in interface ISQL
    • getQueryCountUpdatedAt Link icon

      public Long getQueryCountUpdatedAt()
      Time (epoch) at which the query count was last updated, in milliseconds.
      Specified by:
      getQueryCountUpdatedAt in interface IDatabase
      Specified by:
      getQueryCountUpdatedAt in interface ISQL
    • getQueryUserCount Link icon

      public Long getQueryUserCount()
      Number of unique users who have queried this asset.
      Specified by:
      getQueryUserCount in interface IDatabase
      Specified by:
      getQueryUserCount in interface ISQL
    • getQueryUserMap Link icon

      public Map<String,Long> getQueryUserMap()
      Map of unique users who have queried this asset to the number of times they have queried it.
      Specified by:
      getQueryUserMap in interface IDatabase
      Specified by:
      getQueryUserMap in interface ISQL
    • getSchemaCount Link icon

      public Integer getSchemaCount()
      Number of schemas in this database.
      Specified by:
      getSchemaCount in interface IDatabase
    • getSchemaName Link icon

      public String getSchemaName()
      Simple name of the schema in which this SQL asset exists, or empty if it does not exist within a schema.
      Specified by:
      getSchemaName in interface IDatabase
      Specified by:
      getSchemaName in interface ISQL
    • getSchemaQualifiedName Link icon

      public String getSchemaQualifiedName()
      Unique name of the schema in which this SQL asset exists, or empty if it does not exist within a schema.
      Specified by:
      getSchemaQualifiedName in interface IDatabase
      Specified by:
      getSchemaQualifiedName in interface ISQL
    • getSchemas Link icon

      public SortedSet<ISchema> getSchemas()
      Schemas that exist within this database.
      Specified by:
      getSchemas in interface IDatabase
    • getSqlAIModelContextQualifiedName Link icon

      public String getSqlAIModelContextQualifiedName()
      Unique name of the context in which the model versions exist, or empty if it does not exist within an AI model context.
      Specified by:
      getSqlAIModelContextQualifiedName in interface IDatabase
      Specified by:
      getSqlAIModelContextQualifiedName in interface ISQL
    • getSqlDBTSources Link icon

      public SortedSet<IDbtSource> getSqlDBTSources()
      Sources related to this asset.
      Specified by:
      getSqlDBTSources in interface IDatabase
      Specified by:
      getSqlDBTSources in interface ISQL
    • getSqlDbtModels Link icon

      public SortedSet<IDbtModel> getSqlDbtModels()
      Assets related to the model.
      Specified by:
      getSqlDbtModels in interface IDatabase
      Specified by:
      getSqlDbtModels in interface ISQL
    • getTableName Link icon

      public String getTableName()
      Simple name of the table in which this SQL asset exists, or empty if it does not exist within a table.
      Specified by:
      getTableName in interface IDatabase
      Specified by:
      getTableName in interface ISQL
    • getTableQualifiedName Link icon

      public String getTableQualifiedName()
      Unique name of the table in which this SQL asset exists, or empty if it does not exist within a table.
      Specified by:
      getTableQualifiedName in interface IDatabase
      Specified by:
      getTableQualifiedName in interface ISQL
    • getViewName Link icon

      public String getViewName()
      Simple name of the view in which this SQL asset exists, or empty if it does not exist within a view.
      Specified by:
      getViewName in interface IDatabase
      Specified by:
      getViewName in interface ISQL
    • getViewQualifiedName Link icon

      public String getViewQualifiedName()
      Unique name of the view in which this SQL asset exists, or empty if it does not exist within a view.
      Specified by:
      getViewQualifiedName in interface IDatabase
      Specified by:
      getViewQualifiedName in interface ISQL
    • equals Link icon

      public boolean equals(Object o)
      Overrides:
      equals in class Asset
    • canEqual Link icon

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class Asset
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class Asset
    • toString Link icon

      public String toString()
      Description copied from class: AtlanObject
      Overrides:
      toString in class Asset
    • getTypeName Link icon

      public String getTypeName()
      Fixed typeName for Databases.
      Specified by:
      getTypeName in interface AuditDetail
      Specified by:
      getTypeName in interface IAsset
      Specified by:
      getTypeName in interface ICatalog
      Specified by:
      getTypeName in interface IDatabase
      Specified by:
      getTypeName in interface IReferenceable
      Specified by:
      getTypeName in interface ISQL
      Overrides:
      getTypeName in class Reference