Package org.openmetadata.service.jdbi3
Class TeamRepository
- java.lang.Object
-
- org.openmetadata.service.jdbi3.EntityRepository<Team>
-
- org.openmetadata.service.jdbi3.TeamRepository
-
public class TeamRepository extends EntityRepository<Team>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTeamRepository.TeamCsvclassTeamRepository.TeamUpdaterHandles entity updated from PUT and POST operation.-
Nested classes/interfaces inherited from class org.openmetadata.service.jdbi3.EntityRepository
EntityRepository.EntityUpdater, EntityRepository.Operation
-
-
Field Summary
-
Fields inherited from class org.openmetadata.service.jdbi3.EntityRepository
allowedFields, CACHE_WITH_ID, CACHE_WITH_NAME, dao, daoCollection, entityType, putFields, quoteFqn, supportsExtension, supportsFollower, supportsOwner, supportsSoftDelete, supportsTags, supportsVotes
-
-
Constructor Summary
Constructors Constructor Description TeamRepository(CollectionDAO dao)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcleanup(Team team)TeamclearFields(Team team, EntityUtil.Fields fields)Set the requested fields in an entity.StringexportToCsv(String parentTeam, String user)Override this method to support downloading CSV functionalityprotected List<EntityReference>getChildren(UUID teamId)protected List<EntityReference>getChildren(Team team)TeamRepository.TeamUpdatergetUpdater(Team original, Team updated, EntityRepository.Operation operation)CsvImportResultimportFromCsv(String name, String csv, boolean dryRun, String user)Load CSV provided for bulk uploadvoidinitOrganization()List<TeamHierarchy>listHierarchy(ListFilter filter, int limit, Boolean isJoinable)protected voidpreDelete(Team entity)voidprepare(Team team)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.voidrestorePatchAttributes(Team original, Team updated)PATCH operations can't overwrite certain fields, such as entity ID, fullyQualifiedNames etc.TeamsetFields(Team team, EntityUtil.Fields fields)Set the requested fields in an entity.voidstoreEntity(Team team, boolean update)An entity is stored in the backend database as JSON document.voidstoreRelationships(Team team)This method is called to store all the relationships of an entity.-
Methods inherited from class org.openmetadata.service.jdbi3.EntityRepository
addDerivedTags, addFollower, addRelationship, addRelationship, addRelationship, applyTags, applyTags, bulkAddToRelationship, checkSystemEntityDeletion, clearFieldsInternal, create, createInternal, createOrUpdate, createOrUpdateInternal, delete, deleteByName, deleteExtensionAtTimestamp, deleteExtensionBeforeTimestamp, deleteFollower, deleteFrom, deleteInternal, deleteInternalByName, deleteRelationship, deleteTo, ensureSingleRelationship, find, findBoth, findByName, findByNameOrNull, findFrom, findFromRecords, findTo, findToRecords, get, get, getAllowedFieldsCopy, getAllTags, getByName, getByName, getCommonFields, getContainer, getCustomPropertyFQN, getCustomPropertyFQNPrefix, getEntitiesFromSeedData, getEntitiesFromSeedData, getEntitiesFromSeedData, getExtension, getExtensionAtTimestamp, getExtensionAtTimestampWithOperation, getFields, getFields, getFollowers, getFromEntityRef, getHref, getIngestionPipelines, getLatestExtensionFromTimeseries, getOwner, getOwner, getParent, getReference, getReferenceByName, getResultList, getResultList, getResultsFromAndToTimestamps, getResultsFromAndToTimestamps, getReviewers, getTags, getTags, getToEntityRef, getVersion, getVotes, initializeEntity, initSeedDataFromResources, listAfter, listAfterWithSkipFailure, listAll, listBefore, listVersions, patch, populateOwner, postCreate, postDelete, postUpdate, prepareInternal, removeExtension, restoreEntity, setFieldsInternal, setFullyQualifiedName, setInheritedFields, store, storeExtension, storeOwner, storeRelationshipsInternal, storeTimeSeries, storeTimeSeriesWithOperation, update, update, updateOwner, updateVote, validateOwner, validateRoles, validateUsers, withHref
-
-
-
-
Constructor Detail
-
TeamRepository
public TeamRepository(CollectionDAO dao)
-
-
Method Detail
-
setFields
public Team setFields(Team team, EntityUtil.Fields fields)
Description copied from class:EntityRepositorySet 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:
setFieldsin classEntityRepository<Team>
-
clearFields
public Team clearFields(Team team, EntityUtil.Fields fields)
Description copied from class:EntityRepositorySet 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:
clearFieldsin classEntityRepository<Team>
-
restorePatchAttributes
public void restorePatchAttributes(Team original, Team updated)
Description copied from class:EntityRepositoryPATCH 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:
restorePatchAttributesin classEntityRepository<Team>
-
prepare
public void prepare(Team team)
Description copied from class:EntityRepositoryThis 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:
- 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 .
- Validate all the attributes of an entity.
- 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.
- Specified by:
preparein classEntityRepository<Team>- See Also:
for an example implementation
-
storeEntity
public void storeEntity(Team team, boolean update)
Description copied from class:EntityRepositoryAn 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:
storeEntityin classEntityRepository<Team>- See Also:
for an example implementation
-
storeRelationships
public void storeRelationships(Team team)
Description copied from class:EntityRepositoryThis 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:
storeRelationshipsin classEntityRepository<Team>- See Also:
for an example implementation
-
getUpdater
public TeamRepository.TeamUpdater getUpdater(Team original, Team updated, EntityRepository.Operation operation)
- Overrides:
getUpdaterin classEntityRepository<Team>
-
preDelete
protected void preDelete(Team entity)
- Overrides:
preDeletein classEntityRepository<Team>
-
cleanup
protected void cleanup(Team team)
- Overrides:
cleanupin classEntityRepository<Team>
-
exportToCsv
public String exportToCsv(String parentTeam, String user) throws IOException
Description copied from class:EntityRepositoryOverride this method to support downloading CSV functionality- Overrides:
exportToCsvin classEntityRepository<Team>- Throws:
IOException
-
importFromCsv
public CsvImportResult importFromCsv(String name, String csv, boolean dryRun, String user) throws IOException
Description copied from class:EntityRepositoryLoad CSV provided for bulk upload- Overrides:
importFromCsvin classEntityRepository<Team>- Throws:
IOException
-
listHierarchy
public List<TeamHierarchy> listHierarchy(ListFilter filter, int limit, Boolean isJoinable)
-
getChildren
protected List<EntityReference> getChildren(Team team)
- Overrides:
getChildrenin classEntityRepository<Team>
-
getChildren
protected List<EntityReference> getChildren(UUID teamId)
-
initOrganization
public void initOrganization() throws IOException- Throws:
IOException
-
-