Package org.openmetadata.service.jdbi3
Class RoleRepository
- java.lang.Object
-
- org.openmetadata.service.jdbi3.EntityRepository<Role>
-
- org.openmetadata.service.jdbi3.RoleRepository
-
public class RoleRepository extends EntityRepository<Role>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classRoleRepository.RoleUpdaterHandles 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 RoleRepository(CollectionDAO dao)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RoleclearFields(Role role, EntityUtil.Fields fields)Set the requested fields in an entity.RoleRepository.RoleUpdatergetUpdater(Role original, Role updated, EntityRepository.Operation operation)protected voidpreDelete(Role entity)voidprepare(Role role)If policy does not exist for this role, create a new entity reference.voidrestorePatchAttributes(Role original, Role updated)PATCH operations can't overwrite certain fields, such as entity ID, fullyQualifiedNames etc.RolesetFields(Role role, EntityUtil.Fields fields)Set the requested fields in an entity.voidstoreEntity(Role role, boolean update)For regular incoming POST, PUT, PATCH operation calls,prepare(Role)would create a policy entity reference if it does not exist.voidstoreRelationships(Role role)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, cleanup, clearFieldsInternal, create, createInternal, createOrUpdate, createOrUpdateInternal, delete, deleteByName, deleteExtensionAtTimestamp, deleteExtensionBeforeTimestamp, deleteFollower, deleteFrom, deleteInternal, deleteInternalByName, deleteRelationship, deleteTo, ensureSingleRelationship, exportToCsv, find, findBoth, findByName, findByNameOrNull, findFrom, findFromRecords, findTo, findToRecords, get, get, getAllowedFieldsCopy, getAllTags, getByName, getByName, getChildren, 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, importFromCsv, 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
-
RoleRepository
public RoleRepository(CollectionDAO dao)
-
-
Method Detail
-
setFields
public Role setFields(Role role, 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<Role>
-
clearFields
public Role clearFields(Role role, 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<Role>
-
restorePatchAttributes
public void restorePatchAttributes(Role original, Role 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<Role>
-
prepare
public void prepare(Role role)
If policy does not exist for this role, create a new entity reference. The actual policy gets created within the storeEntity method call.- Specified by:
preparein classEntityRepository<Role>- See Also:
for an example implementation
-
storeEntity
public void storeEntity(Role role, boolean update)
For regular incoming POST, PUT, PATCH operation calls,prepare(Role)would create a policy entity reference if it does not exist.This method ensures that the role and its policy are stored correctly.
- Specified by:
storeEntityin classEntityRepository<Role>- See Also:
for an example implementation
-
storeRelationships
public void storeRelationships(Role role)
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<Role>- See Also:
for an example implementation
-
getUpdater
public RoleRepository.RoleUpdater getUpdater(Role original, Role updated, EntityRepository.Operation operation)
- Overrides:
getUpdaterin classEntityRepository<Role>
-
preDelete
protected void preDelete(Role entity)
- Overrides:
preDeletein classEntityRepository<Role>
-
-