Package com.atlassian.jira.association
Interface NodeAssociationStore
- All Known Implementing Classes:
NodeAssociationStoreImpl
public interface NodeAssociationStore
Manages associations between different types of entities.
- Since:
- v4.4
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createAssociation
(NodeAssocationType type, Long sourceNodeId, Long sinkNodeId) Create an association between two entities, given a particular association type.org.ofbiz.core.entity.GenericValue
createAssociation
(String sourceNodeEntity, Long sourceNodeId, String sinkNodeEntity, Long sinkNodeId, String associationType) Create an association between two entities, given a particular association type.org.ofbiz.core.entity.GenericValue
createAssociation
(org.ofbiz.core.entity.GenericValue source, org.ofbiz.core.entity.GenericValue sink, String associationType) Create an association between two entities, given a particular association type.org.ofbiz.core.entity.GenericValue
getAssociation
(org.ofbiz.core.entity.GenericValue source, org.ofbiz.core.entity.GenericValue sink, String associationType) getSinkIdsFromSource
(NodeAssocationType nodeAssocationType, Long sourceId) getSinkIdsFromSource
(org.ofbiz.core.entity.GenericValue source, String sinkEntityName, String associationType) List<org.ofbiz.core.entity.GenericValue>
getSinksFromSource
(String sourceEntityName, Long sourceNodeId, String sinkEntityName, String associationType) List<org.ofbiz.core.entity.GenericValue>
getSinksFromSource
(org.ofbiz.core.entity.GenericValue source, String sinkEntityName, String associationType) Operates on NodeAssociations - gets MANY sinks from ONE sourcegetSourceIdsFromSink
(NodeAssocationType nodeAssocationType, Long sinkId) getSourceIdsFromSink
(org.ofbiz.core.entity.GenericValue sink, String sourceEntityName, String associationType) List<org.ofbiz.core.entity.GenericValue>
getSourcesFromSink
(org.ofbiz.core.entity.GenericValue sink, String sourceName, String associationType) Operates on NodeAssociations - gets MANY sources from ONE sinkvoid
removeAllAssociationsFromSource
(String entityName, Long sourceId) Remove all entity<->entity associations, given the source.void
removeAssociation
(NodeAssocationType type, Long sourceNodeId, Long sinkNodeId) Removes the given association if it exists.void
removeAssociation
(org.ofbiz.core.entity.GenericValue source, org.ofbiz.core.entity.GenericValue sink, String associationType) void
removeAssociationsFromSink
(org.ofbiz.core.entity.GenericValue sink) Remove all entity<->entity associations, given the sink.void
removeAssociationsFromSource
(NodeAssocationType nodeAssocationType, Long sourceId) Remove associations of the given type from the given source.void
removeAssociationsFromSource
(org.ofbiz.core.entity.GenericValue source) Remove all entity<->entity associations, given the source.void
swapAssociation
(String sourceEntityType, String associationType, org.ofbiz.core.entity.GenericValue oldSink, org.ofbiz.core.entity.GenericValue newSink) Swap all associations of a particular type from one sink to another.void
swapAssociation
(List<org.ofbiz.core.entity.GenericValue> entities, String associationType, org.ofbiz.core.entity.GenericValue fromSink, org.ofbiz.core.entity.GenericValue toSink) Swaps all associations for a given list of entities (say move a list of unresolved issue entities to a new fix for version)
-
Method Details
-
getAssociation
org.ofbiz.core.entity.GenericValue getAssociation(org.ofbiz.core.entity.GenericValue source, org.ofbiz.core.entity.GenericValue sink, String associationType) throws DataAccessException - Throws:
DataAccessException
-
getSinksFromSource
List<org.ofbiz.core.entity.GenericValue> getSinksFromSource(org.ofbiz.core.entity.GenericValue source, String sinkEntityName, String associationType) throws DataAccessException Operates on NodeAssociations - gets MANY sinks from ONE source- Parameters:
source
- The source node to find all associated sink nodes for.sinkEntityName
- The sink Entity type.associationType
- the association type- Returns:
- List of Sinks for the given Source
- Throws:
DataAccessException
- If there is a DB Exception.
-
getSinksFromSource
-
getSourcesFromSink
List<org.ofbiz.core.entity.GenericValue> getSourcesFromSink(org.ofbiz.core.entity.GenericValue sink, String sourceName, String associationType) throws DataAccessException Operates on NodeAssociations - gets MANY sources from ONE sink- Throws:
DataAccessException
- If there is a DB Exception.
-
createAssociation
org.ofbiz.core.entity.GenericValue createAssociation(org.ofbiz.core.entity.GenericValue source, org.ofbiz.core.entity.GenericValue sink, String associationType) throws DataAccessException Create an association between two entities, given a particular association type.If the association already exists - it will not be created.
- Parameters:
source
- the sourcesink
- the sinkassociationType
- the Association Type- Returns:
- The new association, or the existing association if it already existed.
- Throws:
DataAccessException
- If there is a DB Exception.
-
createAssociation
Create an association between two entities, given a particular association type.If the association already exists - it will not be created.
-
removeAssociation
Removes the given association if it exists.- Parameters:
type
- NodeAssocation TypesourceNodeId
- The Source NodesinkNodeId
- The Sink Node (destination node).
-
createAssociation
org.ofbiz.core.entity.GenericValue createAssociation(String sourceNodeEntity, Long sourceNodeId, String sinkNodeEntity, Long sinkNodeId, String associationType) throws DataAccessException Create an association between two entities, given a particular association type.If the association already exists - it will not be created.
NOTE: this is a convenience method that should only be used when you are certain of the related entity id's. This method does not verify the integrity of the links it creates.
- Returns:
- The new association, or the existing association if it already existed.
- Throws:
DataAccessException
- If there is a DB Exception.
-
removeAssociation
void removeAssociation(org.ofbiz.core.entity.GenericValue source, org.ofbiz.core.entity.GenericValue sink, String associationType) throws DataAccessException - Throws:
DataAccessException
-
removeAssociationsFromSource
void removeAssociationsFromSource(org.ofbiz.core.entity.GenericValue source) Remove all entity<->entity associations, given the source.- Parameters:
source
- the Source- See Also:
-
removeAllAssociationsFromSource
Remove all entity<->entity associations, given the source.- Parameters:
entityName
- the Source entity namesourceId
- the Source ID- See Also:
-
removeAssociationsFromSource
Remove associations of the given type from the given source.- Parameters:
nodeAssocationType
- the NodeAssocationTypesourceId
- the ID of the source
-
removeAssociationsFromSink
Remove all entity<->entity associations, given the sink.- Parameters:
sink
- the sink- Throws:
DataAccessException
- If there is a DB Exception.
-
swapAssociation
void swapAssociation(String sourceEntityType, String associationType, org.ofbiz.core.entity.GenericValue oldSink, org.ofbiz.core.entity.GenericValue newSink) throws DataAccessException Swap all associations of a particular type from one sink to another.Used in ComponentDelete and VersionDelete.
- Parameters:
sourceEntityType
- the Source Entity TypeassociationType
- the Association TypeoldSink
- the From sinknewSink
- the To sink- Throws:
DataAccessException
- If there is a DB Exception.
-
swapAssociation
void swapAssociation(List<org.ofbiz.core.entity.GenericValue> entities, String associationType, org.ofbiz.core.entity.GenericValue fromSink, org.ofbiz.core.entity.GenericValue toSink) throws DataAccessException Swaps all associations for a given list of entities (say move a list of unresolved issue entities to a new fix for version)- Parameters:
entities
- the entitiesassociationType
- the Association TypefromSink
- the From sinktoSink
- the To sink- Throws:
DataAccessException
- If there is a DB Exception.
-
getSinkIdsFromSource
-
getSinkIdsFromSource
-
getSourceIdsFromSink
-
getSourceIdsFromSink
-