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.
|
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.
|
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.
|
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(RelatableEntity relatableEntity)
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 removeAllRelationsFromEntityWithName(String relationName, RelatableEntity relatableEntity)
relationName
- relatableEntity
- int removeAllRelationsFromCurrentAndHistoricalEntities(RelatableEntity relatableEntity)
relatableEntity
- Copyright © 2003–2017 Atlassian. All rights reserved.