Class EntityRepository<T extends EntityInterface>
- java.lang.Object
-
- org.openmetadata.service.jdbi3.EntityRepository<T>
-
- Direct Known Subclasses:
BotRepository,ChartRepository,ClassificationRepository,ContainerRepository,DashboardDataModelRepository,DashboardRepository,DatabaseRepository,DatabaseSchemaRepository,DataInsightChartRepository,EventSubscriptionRepository,GlossaryRepository,GlossaryTermRepository,IngestionPipelineRepository,KpiRepository,MetricsRepository,MlModelRepository,PipelineRepository,PolicyRepository,QueryRepository,ReportRepository,RoleRepository,ServiceEntityRepository,TableRepository,TagRepository,TeamRepository,TestCaseRepository,TestConnectionDefinitionRepository,TestDefinitionRepository,TestSuiteRepository,TopicRepository,TypeRepository,UserRepository,WebAnalyticEventRepository,WorkflowRepository
public abstract class EntityRepository<T extends EntityInterface> extends Object
This is the base class used by Entity Resources to perform READ and WRITE operations to the backend database to Create, Retrieve, Update, and Delete entities.An entity has two types of fields - `attributes` and `relationships`.
- The `attributes` are the core properties of the entity, example - entity id, name, fullyQualifiedName, columns for a table, etc.
- The `relationships` are an associated between two entities, example - table belongs to a database, table has a
tag, user owns a table, etc. All relationships are captured using
EntityReference.
CollectionDAO.TableDAOis used as the DAO object to access the table_entity table. All DAO objects for an entity are available indaoCollection.
Relationships between entity is stored in a separate table that captures the edge - fromEntity, toEntity, and the relationship name entity_relationship table and are supported byCollectionDAO.EntityRelationshipDAODAO object.JSON document of an entity stores only required attributes of an entity. Some attributes such as href are not stored and are created on the fly.
Json document of an entity does not store relationships. As an example, JSON document for table entity does not store the relationship database which is of type EntityReference. This is always retrieved from the relationship table when required to ensure, the data stored is efficiently and consistently, and relationship information does not become stale.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classEntityRepository.EntityUpdaterClass that performs PUT and PATCH update operation.static classEntityRepository.Operation
-
Field Summary
Fields Modifier and Type Field Description protected Set<String>allowedFieldsstatic com.google.common.cache.LoadingCache<org.apache.commons.lang3.tuple.Pair<String,UUID>,EntityInterface>CACHE_WITH_IDstatic com.google.common.cache.LoadingCache<org.apache.commons.lang3.tuple.Pair<String,String>,EntityInterface>CACHE_WITH_NAMEprotected EntityDAO<T>daoprotected CollectionDAOdaoCollectionprotected StringentityTypeprotected EntityUtil.FieldsputFieldsFields that can be updated during PUT operationprotected booleanquoteFqnprotected booleansupportsExtensionprotected booleansupportsFollowerprotected booleansupportsOwnerbooleansupportsSoftDeleteprotected booleansupportsTagsprotected booleansupportsVotes
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description List<TagLabel>addDerivedTags(List<TagLabel> tagLabels)Validate given list of tags and add derived tags to itRestUtil.PutResponse<T>addFollower(String updatedBy, UUID entityId, UUID userId)voidaddRelationship(UUID fromId, UUID toId, String fromEntity, String toEntity, Relationship relationship)voidaddRelationship(UUID fromId, UUID toId, String fromEntity, String toEntity, Relationship relationship, boolean bidirectional)voidaddRelationship(UUID fromId, UUID toId, String fromEntity, String toEntity, Relationship relationship, String json, boolean bidirectional)voidapplyTags(List<TagLabel> tagLabels, String targetFQN)Apply tagstagLabelsto the entity or field identified bytargetFQNprotected voidapplyTags(T entity)voidbulkAddToRelationship(UUID fromId, List<UUID> toId, String fromEntity, String toEntity, Relationship relationship)protected voidcheckSystemEntityDeletion(T entity)protected voidcleanup(T entityInterface)abstract TclearFields(T entity, EntityUtil.Fields fields)Set the requested fields in an entity.TclearFieldsInternal(T entity, EntityUtil.Fields fields)Tcreate(javax.ws.rs.core.UriInfo uriInfo, T entity)TcreateInternal(T entity)RestUtil.PutResponse<T>createOrUpdate(javax.ws.rs.core.UriInfo uriInfo, T updated)RestUtil.PutResponse<T>createOrUpdateInternal(javax.ws.rs.core.UriInfo uriInfo, T updated)RestUtil.DeleteResponse<T>delete(String updatedBy, UUID id, boolean recursive, boolean hardDelete)RestUtil.DeleteResponse<T>deleteByName(String updatedBy, String name, boolean recursive, boolean hardDelete)voiddeleteExtensionAtTimestamp(String fqn, String extension, Long timestamp)voiddeleteExtensionBeforeTimestamp(String fqn, String extension, Long timestamp)RestUtil.PutResponse<T>deleteFollower(String updatedBy, UUID entityId, UUID userId)voiddeleteFrom(UUID fromId, String fromEntityType, Relationship relationship, String toEntityType)RestUtil.DeleteResponse<T>deleteInternal(String updatedBy, UUID id, boolean recursive, boolean hardDelete)RestUtil.DeleteResponse<T>deleteInternalByName(String updatedBy, String name, boolean recursive, boolean hardDelete)voiddeleteRelationship(UUID fromId, String fromEntityType, UUID toId, String toEntityType, Relationship relationship)voiddeleteTo(UUID toId, String toEntityType, Relationship relationship, String fromEntityType)voidensureSingleRelationship(String entityType, UUID id, List<?> relations, String relationshipName, boolean mustHaveRelationship)StringexportToCsv(String name, String user)Override this method to support downloading CSV functionalityTfind(UUID id, Include include)Find method is used for getting an entity only with core fields stored as JSON without any relational fields setList<EntityReference>findBoth(UUID entity1, String entityType1, Relationship relationship, String entity2)TfindByName(String fqn, Include include)Find method is used for getting an entity only with core fields stored as JSON without any relational fields setTfindByNameOrNull(String fqn, Include include)List<EntityReference>findFrom(UUID toId, String toEntityType, Relationship relationship, String fromEntityType)List<CollectionDAO.EntityRelationshipRecord>findFromRecords(UUID toId, String toEntityType, Relationship relationship, String fromEntityType)List<EntityReference>findTo(UUID fromId, String fromEntityType, Relationship relationship, String toEntityType)List<CollectionDAO.EntityRelationshipRecord>findToRecords(UUID fromId, String fromEntityType, Relationship relationship, String toEntityType)Tget(javax.ws.rs.core.UriInfo uriInfo, UUID id, EntityUtil.Fields fields)Tget(javax.ws.rs.core.UriInfo uriInfo, UUID id, EntityUtil.Fields fields, Include include, boolean fromCache)Used for getting an entity with a set of requested fieldsSet<String>getAllowedFieldsCopy()List<TagLabel>getAllTags(EntityInterface entity)TgetByName(javax.ws.rs.core.UriInfo uriInfo, String fqn, EntityUtil.Fields fields)TgetByName(javax.ws.rs.core.UriInfo uriInfo, String fqn, EntityUtil.Fields fields, Include include, boolean fromCache)protected List<EntityReference>getChildren(T entity)Set<String>getCommonFields(Set<String> input)EntityReferencegetContainer(UUID toId)protected StringgetCustomPropertyFQN(String entityType, String propertyName)protected StringgetCustomPropertyFQNPrefix(String entityType)List<T>getEntitiesFromSeedData()List<T>getEntitiesFromSeedData(String path)static <U> List<U>getEntitiesFromSeedData(String entityType, String path, Class<U> clazz)ObjectgetExtension(T entity)StringgetExtensionAtTimestamp(String fqn, String extension, Long timestamp)StringgetExtensionAtTimestampWithOperation(String fqn, String extension, Long timestamp, String operation)EntityUtil.FieldsgetFields(String fields)protected EntityUtil.FieldsgetFields(Set<String> fields)protected List<EntityReference>getFollowers(T entity)EntityReferencegetFromEntityRef(UUID toId, Relationship relationship, String fromEntityType, boolean mustHaveRelationship)URIgetHref(javax.ws.rs.core.UriInfo uriInfo, UUID id)protected List<EntityReference>getIngestionPipelines(T service)StringgetLatestExtensionFromTimeseries(String fqn, String extension)EntityReferencegetOwner(EntityReference ref)EntityReferencegetOwner(T entity)protected EntityReferencegetParent(T entity)EntityReferencegetReference(UUID id, Include include)getReference is used for getting the entity references from the entity in the cache.EntityReferencegetReferenceByName(String fqn, Include include)ResultList<T>getResultList(List<T> entities, String beforeCursor, String afterCursor, int total)ResultList<T>getResultList(List<T> entities, List<String> errors, String beforeCursor, String afterCursor, int total)List<String>getResultsFromAndToTimestamps(String fullyQualifiedName, String extension, Long startTs, Long endTs)List<String>getResultsFromAndToTimestamps(String fqn, String extension, Long startTs, Long endTs, CollectionDAO.EntityExtensionTimeSeriesDAO.OrderBy orderBy)protected List<EntityReference>getReviewers(T entity)protected List<TagLabel>getTags(String fqn)protected List<TagLabel>getTags(T entity)EntityReferencegetToEntityRef(UUID fromId, Relationship relationship, String toEntityType, boolean mustHaveRelationship)EntityRepository.EntityUpdatergetUpdater(T original, T updated, EntityRepository.Operation operation)TgetVersion(UUID id, String version)protected VotesgetVotes(T entity)CsvImportResultimportFromCsv(String name, String csv, boolean dryRun, String user)Load CSV provided for bulk uploadvoidinitializeEntity(T entity)Initialize a given entity if it does not exist.voidinitSeedDataFromResources()Initialize data from json files if seed data does not exist in corresponding tables.ResultList<T>listAfter(javax.ws.rs.core.UriInfo uriInfo, EntityUtil.Fields fields, ListFilter filter, int limitParam, String after)ResultList<T>listAfterWithSkipFailure(javax.ws.rs.core.UriInfo uriInfo, EntityUtil.Fields fields, ListFilter filter, int limitParam, String after)List<T>listAll(EntityUtil.Fields fields, ListFilter filter)ResultList<T>listBefore(javax.ws.rs.core.UriInfo uriInfo, EntityUtil.Fields fields, ListFilter filter, int limitParam, String before)EntityHistorylistVersions(UUID id)RestUtil.PatchResponse<T>patch(javax.ws.rs.core.UriInfo uriInfo, UUID id, String user, javax.json.JsonPatch patch)protected voidpopulateOwner(EntityReference owner)protected voidpostCreate(T entity)protected voidpostDelete(T entity)protected voidpostUpdate(T entity)protected voidpreDelete(T entity)abstract voidprepare(T entity)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.voidprepareInternal(T entity)voidremoveExtension(EntityInterface entity)RestUtil.PutResponse<T>restoreEntity(String updatedBy, String entityType, UUID id)voidrestorePatchAttributes(T original, T updated)PATCH operations can't overwrite certain fields, such as entity ID, fullyQualifiedNames etc.abstract TsetFields(T entity, EntityUtil.Fields fields)Set the requested fields in an entity.TsetFieldsInternal(T entity, EntityUtil.Fields fields)voidsetFullyQualifiedName(T entity)Set fullyQualifiedName of an entityTsetInheritedFields(T entity, EntityUtil.Fields fields)This method is called to set inherited fields that an entity inherits from its parent.protected voidstore(T entity, boolean update)abstract voidstoreEntity(T entity, boolean update)An entity is stored in the backend database as JSON document.voidstoreExtension(EntityInterface entity)protected voidstoreOwner(T entity, EntityReference owner)abstract voidstoreRelationships(T entity)This method is called to store all the relationships of an entity.voidstoreRelationshipsInternal(T entity)protected voidstoreTimeSeries(String fqn, String extension, String jsonSchema, String entityJson, Long timestamp)protected voidstoreTimeSeriesWithOperation(String fqn, String extension, String jsonSchema, String entityJson, Long timestamp, String operation, boolean update)RestUtil.PutResponse<T>update(javax.ws.rs.core.UriInfo uriInfo, T original, T updated)voidupdate(TaskDetails task, MessageParser.EntityLink entityLink, String newValue, String user)Update an entity based suggested description and tags in the taskvoidupdateOwner(T ownedEntity, EntityReference originalOwner, EntityReference newOwner)RestUtil.PutResponse<T>updateVote(String updatedBy, UUID entityId, VoteRequest request)EntityReferencevalidateOwner(EntityReference owner)voidvalidateRoles(List<EntityReference> roles)voidvalidateUsers(List<EntityReference> entityReferences)TwithHref(javax.ws.rs.core.UriInfo uriInfo, T entity)
-
-
-
Field Detail
-
CACHE_WITH_NAME
public static final com.google.common.cache.LoadingCache<org.apache.commons.lang3.tuple.Pair<String,String>,EntityInterface> CACHE_WITH_NAME
-
CACHE_WITH_ID
public static final com.google.common.cache.LoadingCache<org.apache.commons.lang3.tuple.Pair<String,UUID>,EntityInterface> CACHE_WITH_ID
-
entityType
protected final String entityType
-
dao
protected final EntityDAO<T extends EntityInterface> dao
-
daoCollection
protected final CollectionDAO daoCollection
-
supportsSoftDelete
public final boolean supportsSoftDelete
-
supportsTags
protected final boolean supportsTags
-
supportsOwner
protected final boolean supportsOwner
-
supportsFollower
protected final boolean supportsFollower
-
supportsExtension
protected final boolean supportsExtension
-
supportsVotes
protected final boolean supportsVotes
-
quoteFqn
protected boolean quoteFqn
-
putFields
protected final EntityUtil.Fields putFields
Fields that can be updated during PUT operation
-
-
Method Detail
-
setFields
public abstract T setFields(T entity, EntityUtil.Fields fields)
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.
-
clearFields
public abstract T clearFields(T entity, EntityUtil.Fields fields)
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.
-
prepare
public abstract void prepare(T entity)
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:
- 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.
- See Also:
for an example implementation
-
storeEntity
public abstract void storeEntity(T entity, boolean update)
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.- See Also:
for an example implementation
-
storeRelationships
public abstract void storeRelationships(T entity)
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.- See Also:
for an example implementation
-
setInheritedFields
public T setInheritedFields(T entity, EntityUtil.Fields fields)
This method is called to set inherited fields that an entity inherits from its parent.- See Also:
for an example implementation
-
restorePatchAttributes
public void restorePatchAttributes(T original, T updated)
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.
-
setFullyQualifiedName
public void setFullyQualifiedName(T entity)
Set fullyQualifiedName of an entity
-
update
public void update(TaskDetails task, MessageParser.EntityLink entityLink, String newValue, String user)
Update an entity based suggested description and tags in the task
-
initSeedDataFromResources
public void initSeedDataFromResources() throws IOExceptionInitialize data from json files if seed data does not exist in corresponding tables. Seed data is stored under openmetadata-service/src/main/resources/json/data/{entityType}This method needs to be explicitly called, typically from initialize method. See
RoleResource.initialize(OpenMetadataApplicationConfig)- Throws:
IOException
-
getEntitiesFromSeedData
public List<T> getEntitiesFromSeedData() throws IOException
- Throws:
IOException
-
getEntitiesFromSeedData
public List<T> getEntitiesFromSeedData(String path) throws IOException
- Throws:
IOException
-
getEntitiesFromSeedData
public static <U> List<U> getEntitiesFromSeedData(String entityType, String path, Class<U> clazz) throws IOException
- Throws:
IOException
-
initializeEntity
public void initializeEntity(T entity)
Initialize a given entity if it does not exist.
-
getUpdater
public EntityRepository.EntityUpdater getUpdater(T original, T updated, EntityRepository.Operation operation)
-
get
public final T get(javax.ws.rs.core.UriInfo uriInfo, UUID id, EntityUtil.Fields fields)
-
get
public final T get(javax.ws.rs.core.UriInfo uriInfo, UUID id, EntityUtil.Fields fields, Include include, boolean fromCache)
Used for getting an entity with a set of requested fields
-
getReference
public final EntityReference getReference(UUID id, Include include) throws EntityNotFoundException
getReference is used for getting the entity references from the entity in the cache.- Throws:
EntityNotFoundException
-
find
public T find(UUID id, Include include) throws EntityNotFoundException
Find method is used for getting an entity only with core fields stored as JSON without any relational fields set- Throws:
EntityNotFoundException
-
getByName
public T getByName(javax.ws.rs.core.UriInfo uriInfo, String fqn, EntityUtil.Fields fields)
-
getByName
public final T getByName(javax.ws.rs.core.UriInfo uriInfo, String fqn, EntityUtil.Fields fields, Include include, boolean fromCache)
-
getReferenceByName
public final EntityReference getReferenceByName(String fqn, Include include)
-
findByName
public T findByName(String fqn, Include include)
Find method is used for getting an entity only with core fields stored as JSON without any relational fields set
-
listAll
public final List<T> listAll(EntityUtil.Fields fields, ListFilter filter)
-
listAfter
public ResultList<T> listAfter(javax.ws.rs.core.UriInfo uriInfo, EntityUtil.Fields fields, ListFilter filter, int limitParam, String after)
-
listAfterWithSkipFailure
public ResultList<T> listAfterWithSkipFailure(javax.ws.rs.core.UriInfo uriInfo, EntityUtil.Fields fields, ListFilter filter, int limitParam, String after) throws IOException
- Throws:
IOException
-
listBefore
public ResultList<T> listBefore(javax.ws.rs.core.UriInfo uriInfo, EntityUtil.Fields fields, ListFilter filter, int limitParam, String before)
-
listVersions
public EntityHistory listVersions(UUID id)
-
prepareInternal
public void prepareInternal(T entity)
-
storeRelationshipsInternal
public void storeRelationshipsInternal(T entity)
-
setFieldsInternal
public T setFieldsInternal(T entity, EntityUtil.Fields fields)
-
clearFieldsInternal
public T clearFieldsInternal(T entity, EntityUtil.Fields fields)
-
createOrUpdate
public final RestUtil.PutResponse<T> createOrUpdate(javax.ws.rs.core.UriInfo uriInfo, T updated)
-
createOrUpdateInternal
public final RestUtil.PutResponse<T> createOrUpdateInternal(javax.ws.rs.core.UriInfo uriInfo, T updated)
-
postCreate
protected void postCreate(T entity)
-
postUpdate
protected void postUpdate(T entity)
-
update
public RestUtil.PutResponse<T> update(javax.ws.rs.core.UriInfo uriInfo, T original, T updated)
-
patch
public final RestUtil.PatchResponse<T> patch(javax.ws.rs.core.UriInfo uriInfo, UUID id, String user, javax.json.JsonPatch patch)
-
addFollower
public RestUtil.PutResponse<T> addFollower(String updatedBy, UUID entityId, UUID userId)
-
updateVote
public RestUtil.PutResponse<T> updateVote(String updatedBy, UUID entityId, VoteRequest request)
-
delete
public final RestUtil.DeleteResponse<T> delete(String updatedBy, UUID id, boolean recursive, boolean hardDelete)
-
deleteByName
public final RestUtil.DeleteResponse<T> deleteByName(String updatedBy, String name, boolean recursive, boolean hardDelete)
-
preDelete
protected void preDelete(T entity)
-
postDelete
protected void postDelete(T entity)
-
deleteInternalByName
public final RestUtil.DeleteResponse<T> deleteInternalByName(String updatedBy, String name, boolean recursive, boolean hardDelete)
-
deleteInternal
public final RestUtil.DeleteResponse<T> deleteInternal(String updatedBy, UUID id, boolean recursive, boolean hardDelete)
-
cleanup
protected void cleanup(T entityInterface)
-
deleteFollower
public RestUtil.PutResponse<T> deleteFollower(String updatedBy, UUID entityId, UUID userId)
-
getResultList
public final ResultList<T> getResultList(List<T> entities, String beforeCursor, String afterCursor, int total)
-
getResultList
public final ResultList<T> getResultList(List<T> entities, List<String> errors, String beforeCursor, String afterCursor, int total)
-
store
protected void store(T entity, boolean update)
-
storeTimeSeries
protected void storeTimeSeries(String fqn, String extension, String jsonSchema, String entityJson, Long timestamp)
-
storeTimeSeriesWithOperation
protected void storeTimeSeriesWithOperation(String fqn, String extension, String jsonSchema, String entityJson, Long timestamp, String operation, boolean update)
-
getExtensionAtTimestamp
public String getExtensionAtTimestamp(String fqn, String extension, Long timestamp)
-
getExtensionAtTimestampWithOperation
public String getExtensionAtTimestampWithOperation(String fqn, String extension, Long timestamp, String operation)
-
getLatestExtensionFromTimeseries
public String getLatestExtensionFromTimeseries(String fqn, String extension)
-
getResultsFromAndToTimestamps
public List<String> getResultsFromAndToTimestamps(String fullyQualifiedName, String extension, Long startTs, Long endTs)
-
getResultsFromAndToTimestamps
public List<String> getResultsFromAndToTimestamps(String fqn, String extension, Long startTs, Long endTs, CollectionDAO.EntityExtensionTimeSeriesDAO.OrderBy orderBy)
-
deleteExtensionAtTimestamp
public void deleteExtensionAtTimestamp(String fqn, String extension, Long timestamp)
-
deleteExtensionBeforeTimestamp
public void deleteExtensionBeforeTimestamp(String fqn, String extension, Long timestamp)
-
storeExtension
public void storeExtension(EntityInterface entity)
-
removeExtension
public void removeExtension(EntityInterface entity)
-
addDerivedTags
public final List<TagLabel> addDerivedTags(List<TagLabel> tagLabels)
Validate given list of tags and add derived tags to it
-
applyTags
protected void applyTags(T entity)
-
applyTags
public void applyTags(List<TagLabel> tagLabels, String targetFQN)
Apply tagstagLabelsto the entity or field identified bytargetFQN
-
getFollowers
protected List<EntityReference> getFollowers(T entity)
-
restoreEntity
public RestUtil.PutResponse<T> restoreEntity(String updatedBy, String entityType, UUID id)
-
addRelationship
public void addRelationship(UUID fromId, UUID toId, String fromEntity, String toEntity, Relationship relationship)
-
addRelationship
public void addRelationship(UUID fromId, UUID toId, String fromEntity, String toEntity, Relationship relationship, boolean bidirectional)
-
addRelationship
public void addRelationship(UUID fromId, UUID toId, String fromEntity, String toEntity, Relationship relationship, String json, boolean bidirectional)
-
bulkAddToRelationship
public final void bulkAddToRelationship(UUID fromId, List<UUID> toId, String fromEntity, String toEntity, Relationship relationship)
-
findBoth
public List<EntityReference> findBoth(UUID entity1, String entityType1, Relationship relationship, String entity2)
-
findFrom
public List<EntityReference> findFrom(UUID toId, String toEntityType, Relationship relationship, String fromEntityType)
-
findFromRecords
public List<CollectionDAO.EntityRelationshipRecord> findFromRecords(UUID toId, String toEntityType, Relationship relationship, String fromEntityType)
-
getContainer
public EntityReference getContainer(UUID toId)
-
getFromEntityRef
public EntityReference getFromEntityRef(UUID toId, Relationship relationship, String fromEntityType, boolean mustHaveRelationship)
-
getToEntityRef
public EntityReference getToEntityRef(UUID fromId, Relationship relationship, String toEntityType, boolean mustHaveRelationship)
-
ensureSingleRelationship
public void ensureSingleRelationship(String entityType, UUID id, List<?> relations, String relationshipName, boolean mustHaveRelationship)
-
findTo
public final List<EntityReference> findTo(UUID fromId, String fromEntityType, Relationship relationship, String toEntityType)
-
findToRecords
public final List<CollectionDAO.EntityRelationshipRecord> findToRecords(UUID fromId, String fromEntityType, Relationship relationship, String toEntityType)
-
deleteRelationship
public void deleteRelationship(UUID fromId, String fromEntityType, UUID toId, String toEntityType, Relationship relationship)
-
deleteTo
public void deleteTo(UUID toId, String toEntityType, Relationship relationship, String fromEntityType)
-
deleteFrom
public void deleteFrom(UUID fromId, String fromEntityType, Relationship relationship, String toEntityType)
-
validateUsers
public void validateUsers(List<EntityReference> entityReferences)
-
validateRoles
public void validateRoles(List<EntityReference> roles)
-
getOwner
public EntityReference getOwner(T entity)
-
getParent
protected EntityReference getParent(T entity)
-
getChildren
protected List<EntityReference> getChildren(T entity)
-
getReviewers
protected List<EntityReference> getReviewers(T entity)
-
getOwner
public EntityReference getOwner(EntityReference ref)
-
populateOwner
protected void populateOwner(EntityReference owner)
-
storeOwner
protected void storeOwner(T entity, EntityReference owner)
-
updateOwner
public void updateOwner(T ownedEntity, EntityReference originalOwner, EntityReference newOwner)
-
getFields
public final EntityUtil.Fields getFields(String fields)
-
getFields
protected final EntityUtil.Fields getFields(Set<String> fields)
-
getIngestionPipelines
protected List<EntityReference> getIngestionPipelines(T service)
-
checkSystemEntityDeletion
protected void checkSystemEntityDeletion(T entity)
-
validateOwner
public EntityReference validateOwner(EntityReference owner)
-
exportToCsv
public String exportToCsv(String name, String user) throws IOException
Override this method to support downloading CSV functionality- Throws:
IOException
-
importFromCsv
public CsvImportResult importFromCsv(String name, String csv, boolean dryRun, String user) throws IOException
Load CSV provided for bulk upload- Throws:
IOException
-
getAllTags
public List<TagLabel> getAllTags(EntityInterface entity)
-
-