public interface RelationDao<S extends RelatableEntity,T extends RelatableEntity>
RelationManager
Modifier and Type | Method and Description |
---|---|
RelationEntity<S,T> |
createRelationEntity(S source,
T target,
RelationDescriptor<?,?> relationDescriptor)
Create new relation.
|
@Nullable RelationEntity<S,T> |
getRelationEntity(S source,
T target,
RelationDescriptor<?,?> relationDescriptor)
Get relation for given content, type and name.
|
int |
getRelationsCount(S source,
T target,
RelationDescriptor<?,?> relationDescriptor)
Get total number of relations for given content, type and name.
|
@NonNull List<S> |
getSources(RelationQuery<T> request,
int start,
int limit)
Fetch all related sources for the entity.
|
int |
getSourcesCount(RelationQuery<T> request)
Count of all related sources for the entity.
|
@NonNull List<T> |
getTargets(RelationQuery<S> request,
int start,
int limit)
Fetch all related targets for the entity.
|
int |
getTargetsCount(RelationQuery<S> request)
Count of all related targets for the entity.
|
int |
removeAllRelations(Iterable<? extends RelatableEntity> relatableEntities)
This method removes all relations (across all names and types), where given entity participates.
|
int |
removeAllRelations(RelatableEntity relatableEntity)
This method removes all relations (across all names and types), where given entity participates.
|
int |
removeAllRelationsFromCurrentAndHistoricalEntities(Iterable<? extends RelatableEntity> relatableEntities)
This method removes all relations (across all names and types), where given entity participates.
|
int |
removeAllRelationsFromCurrentAndHistoricalEntities(RelatableEntity relatableEntity)
This method removes all relations (across all names and types), where given entity participates.
|
int |
removeAllRelationsFromEntityWithName(String relationName,
RelatableEntity relatableEntity)
This method remove all relations with the given name, where the given entity participates
|
void |
removeRelationEntity(RelationEntity<S,T> relationEntity)
Remove relation
|
int getRelationsCount(S source, T target, RelationDescriptor<?,?> relationDescriptor)
source
- target
- relationDescriptor
- specifies relation metadata, such as type and nameRelationDescriptor
RelationEntity<S,T> createRelationEntity(S source, T target, RelationDescriptor<?,?> relationDescriptor)
source
- target
- relationDescriptor
- specifies relation metadata, such as type and nameRelationEntity
void removeRelationEntity(RelationEntity<S,T> relationEntity)
relationEntity
- RelationEntity
@Nullable RelationEntity<S,T> getRelationEntity(S source, T target, RelationDescriptor<?,?> relationDescriptor)
source
- target
- relationDescriptor
- specifies relation metadata, such as type and nameRelationEntity
or null
if no relations found@NonNull List<S> getSources(RelationQuery<T> request, int start, int limit)
request
argumentrequest
- start
- limit
- RelatableEntity
RelationQuery
@NonNull List<T> getTargets(RelationQuery<S> request, int start, int limit)
request
argumentrequest
- start
- limit
- RelatableEntity
RelationQuery
int getSourcesCount(RelationQuery<T> request)
request
argumentrequest
- int getTargetsCount(RelationQuery<S> request)
request
argumentrequest
- int removeAllRelations(RelatableEntity relatableEntity)
relatableEntity
- int removeAllRelations(Iterable<? extends RelatableEntity> relatableEntities)
relatableEntities
- int removeAllRelationsFromEntityWithName(String relationName, RelatableEntity relatableEntity)
relationName
- relatableEntity
- int removeAllRelationsFromCurrentAndHistoricalEntities(RelatableEntity relatableEntity)
relatableEntity
- int removeAllRelationsFromCurrentAndHistoricalEntities(Iterable<? extends RelatableEntity> relatableEntities)
relatableEntities
- Copyright © 2003–2019 Atlassian. All rights reserved.