Class TeamRepository

java.lang.Object
org.openmetadata.service.jdbi3.EntityRepository<Team>
org.openmetadata.service.jdbi3.TeamRepository

public class TeamRepository extends EntityRepository<Team>
  • Constructor Details

    • TeamRepository

      public TeamRepository()
  • Method Details

    • setFields

      public void setFields(Team team, EntityUtil.Fields fields)
      Description copied from class: EntityRepository
      Set the requested fields in an entity. This is used for requesting specific fields in the object during GET operations. It is also used during PUT and PATCH operations to set up fields that can be updated.
      Specified by:
      setFields in class EntityRepository<Team>
    • clearFields

      public void clearFields(Team team, EntityUtil.Fields fields)
      Description copied from class: EntityRepository
      Set the requested fields in an entity. This is used for requesting specific fields in the object during GET operations. It is also used during PUT and PATCH operations to set up fields that can be updated.
      Specified by:
      clearFields in class EntityRepository<Team>
    • restorePatchAttributes

      public void restorePatchAttributes(Team original, Team updated)
      Description copied from class: EntityRepository
      PATCH operations can't overwrite certain fields, such as entity ID, fullyQualifiedNames etc. Instead of throwing an error, we take lenient approach of ignoring the user error and restore those attributes based on what is already stored in the original entity.
      Overrides:
      restorePatchAttributes in class EntityRepository<Team>
    • prepare

      public void prepare(Team team, boolean update)
      Description copied from class: EntityRepository
      This method is used for validating an entity to be created during POST, PUT, and PATCH operations and prepare the entity with all the required attributes and relationships.

      The implementation of this method must perform the following:

      1. Prepare the values for attributes that are not required in the request but can be derived on the server side. Example - >FullyQualifiedNames of an entity can be derived from the hierarchy that an entity belongs to .
      2. Validate all the attributes of an entity.
      3. Validate all the relationships of an entity. As an example - during table creation, relationships such as Tags, Owner, Databasea table belongs to are validated. During validation additional information that is not required in the create/update request are set up in the corresponding relationship fields.
      At the end of this operation, entity is expected to be valid and fully constructed with all the fields that will be sent as payload in the POST, PUT, and PATCH operations response.
      Specified by:
      prepare in class EntityRepository<Team>
      See Also:
    • bulkAddAssets

      public BulkOperationResult bulkAddAssets(String domainName, BulkAssets request)
    • bulkRemoveAssets

      public BulkOperationResult bulkRemoveAssets(String domainName, BulkAssets request)
    • storeEntity

      public void storeEntity(Team team, boolean update)
      Description copied from class: EntityRepository
      An entity is stored in the backend database as JSON document. The JSON includes some attributes of the entity and does not include attributes such as href. The relationship fields of an entity is never stored in the JSON document. It is always reconstructed based on relationship edges from the backend database.

      As an example, when table entity is stored, the attributes such as href and the relationships such as owner, database, and tags are set to null. These attributes are restored back after the JSON document is stored to be sent as response.
      Specified by:
      storeEntity in class EntityRepository<Team>
      See Also:
    • storeRelationships

      public void storeRelationships(Team team)
      Description copied from class: EntityRepository
      This method is called to store all the relationships of an entity. It is expected that all relationships are already validated and completely setup before this method is called and no validation of relationships is required.
      Specified by:
      storeRelationships in class EntityRepository<Team>
      See Also:
    • setInheritedFields

      public void setInheritedFields(Team team, EntityUtil.Fields fields)
      Description copied from class: EntityRepository
      This method is called to set inherited fields that an entity inherits from its parent.
      Overrides:
      setInheritedFields in class EntityRepository<Team>
      See Also:
    • getUpdater

      public TeamRepository.TeamUpdater getUpdater(Team original, Team updated, EntityRepository.Operation operation)
      Overrides:
      getUpdater in class EntityRepository<Team>
    • preDelete

      protected void preDelete(Team entity, String deletedBy)
      Overrides:
      preDelete in class EntityRepository<Team>
    • cleanup

      protected void cleanup(Team team)
      Overrides:
      cleanup in class EntityRepository<Team>
    • exportToCsv

      public String exportToCsv(String parentTeam, String user) throws IOException
      Description copied from class: EntityRepository
      Override this method to support downloading CSV functionality
      Overrides:
      exportToCsv in class EntityRepository<Team>
      Throws:
      IOException
    • importFromCsv

      public CsvImportResult importFromCsv(String name, String csv, boolean dryRun, String user) throws IOException
      Description copied from class: EntityRepository
      Load CSV provided for bulk upload
      Overrides:
      importFromCsv in class EntityRepository<Team>
      Throws:
      IOException
    • listHierarchy

      public List<TeamHierarchy> listHierarchy(ListFilter filter, int limit, Boolean isJoinable)
    • getChildren

      protected List<EntityReference> getChildren(Team team)
      Overrides:
      getChildren in class EntityRepository<Team>
    • getChildren

      protected List<EntityReference> getChildren(UUID teamId)
    • initOrganization

      public void initOrganization()