Package com.atlassian.jira.association
Class NodeAssociationStoreImpl
java.lang.Object
com.atlassian.jira.association.NodeAssociationStoreImpl
- All Implemented Interfaces:
NodeAssociationStore
-
Constructor Summary
Constructors -
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 sourceNodeId) 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 sinkNodeId) getSourceIdsFromSink
(org.ofbiz.core.entity.GenericValue sink, String sourceEntity, 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 sourceNodeId) 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 sourceEntityName, String associationType, org.ofbiz.core.entity.GenericValue fromSink, org.ofbiz.core.entity.GenericValue toSink) 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)
-
Constructor Details
-
NodeAssociationStoreImpl
-
-
Method Details
-
getSinksFromSource
public List<org.ofbiz.core.entity.GenericValue> getSinksFromSource(org.ofbiz.core.entity.GenericValue source, String sinkEntityName, String associationType) throws DataAccessException Description copied from interface:NodeAssociationStore
Operates on NodeAssociations - gets MANY sinks from ONE source- Specified by:
getSinksFromSource
in interfaceNodeAssociationStore
- 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
public List<org.ofbiz.core.entity.GenericValue> getSinksFromSource(String sourceEntityName, Long sourceNodeId, String sinkEntityName, String associationType) - Specified by:
getSinksFromSource
in interfaceNodeAssociationStore
-
getSourcesFromSink
public List<org.ofbiz.core.entity.GenericValue> getSourcesFromSink(org.ofbiz.core.entity.GenericValue sink, String sourceName, String associationType) throws DataAccessException Description copied from interface:NodeAssociationStore
Operates on NodeAssociations - gets MANY sources from ONE sink- Specified by:
getSourcesFromSink
in interfaceNodeAssociationStore
- Throws:
DataAccessException
- If there is a DB Exception.
-
createAssociation
public 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.
- Specified by:
createAssociation
in interfaceNodeAssociationStore
- 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
Description copied from interface:NodeAssociationStore
Create an association between two entities, given a particular association type.If the association already exists - it will not be created.
- Specified by:
createAssociation
in interfaceNodeAssociationStore
-
createAssociation
public org.ofbiz.core.entity.GenericValue createAssociation(String sourceNodeEntity, Long sourceNodeId, String sinkNodeEntity, Long sinkNodeId, String associationType) throws DataAccessException Description copied from interface:NodeAssociationStore
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.
- Specified by:
createAssociation
in interfaceNodeAssociationStore
- Returns:
- The new association, or the existing association if it already existed.
- Throws:
DataAccessException
- If there is a DB Exception.
-
removeAssociation
Description copied from interface:NodeAssociationStore
Removes the given association if it exists.- Specified by:
removeAssociation
in interfaceNodeAssociationStore
- Parameters:
type
- NodeAssocation TypesourceNodeId
- The Source NodesinkNodeId
- The Sink Node (destination node).
-
removeAssociation
public void removeAssociation(org.ofbiz.core.entity.GenericValue source, org.ofbiz.core.entity.GenericValue sink, String associationType) throws DataAccessException - Specified by:
removeAssociation
in interfaceNodeAssociationStore
- Throws:
DataAccessException
-
removeAssociationsFromSource
public void removeAssociationsFromSource(org.ofbiz.core.entity.GenericValue source) throws DataAccessException Description copied from interface:NodeAssociationStore
Remove all entity<->entity associations, given the source.- Specified by:
removeAssociationsFromSource
in interfaceNodeAssociationStore
- Parameters:
source
- the Source- Throws:
DataAccessException
- See Also:
-
removeAllAssociationsFromSource
Description copied from interface:NodeAssociationStore
Remove all entity<->entity associations, given the source.- Specified by:
removeAllAssociationsFromSource
in interfaceNodeAssociationStore
- Parameters:
entityName
- the Source entity namesourceId
- the Source ID- See Also:
-
removeAssociationsFromSource
Description copied from interface:NodeAssociationStore
Remove associations of the given type from the given source.- Specified by:
removeAssociationsFromSource
in interfaceNodeAssociationStore
- Parameters:
nodeAssocationType
- the NodeAssocationTypesourceNodeId
- the ID of the source
-
removeAssociationsFromSink
public void removeAssociationsFromSink(org.ofbiz.core.entity.GenericValue sink) throws DataAccessException Description copied from interface:NodeAssociationStore
Remove all entity<->entity associations, given the sink.- Specified by:
removeAssociationsFromSink
in interfaceNodeAssociationStore
- Parameters:
sink
- the sink- Throws:
DataAccessException
- If there is a DB Exception.
-
swapAssociation
public void swapAssociation(String sourceEntityName, String associationType, org.ofbiz.core.entity.GenericValue fromSink, org.ofbiz.core.entity.GenericValue toSink) throws DataAccessException Description copied from interface:NodeAssociationStore
Swap all associations of a particular type from one sink to another.Used in ComponentDelete and VersionDelete.
- Specified by:
swapAssociation
in interfaceNodeAssociationStore
- Parameters:
sourceEntityName
- the Source Entity TypeassociationType
- the Association TypefromSink
- the From sinktoSink
- the To sink- Throws:
DataAccessException
- If there is a DB Exception.
-
swapAssociation
public 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 Description copied from interface:NodeAssociationStore
Swaps all associations for a given list of entities (say move a list of unresolved issue entities to a new fix for version)- Specified by:
swapAssociation
in interfaceNodeAssociationStore
- Parameters:
entities
- the entitiesassociationType
- the Association TypefromSink
- the From sinktoSink
- the To sink- Throws:
DataAccessException
- If there is a DB Exception.
-
getAssociation
public org.ofbiz.core.entity.GenericValue getAssociation(org.ofbiz.core.entity.GenericValue source, org.ofbiz.core.entity.GenericValue sink, String associationType) throws DataAccessException - Specified by:
getAssociation
in interfaceNodeAssociationStore
- Throws:
DataAccessException
-
getSinkIdsFromSource
public List<Long> getSinkIdsFromSource(org.ofbiz.core.entity.GenericValue source, String sinkEntityName, String associationType) - Specified by:
getSinkIdsFromSource
in interfaceNodeAssociationStore
-
getSinkIdsFromSource
- Specified by:
getSinkIdsFromSource
in interfaceNodeAssociationStore
-
getSourceIdsFromSink
public List<Long> getSourceIdsFromSink(org.ofbiz.core.entity.GenericValue sink, String sourceEntity, String associationType) - Specified by:
getSourceIdsFromSink
in interfaceNodeAssociationStore
-
getSourceIdsFromSink
- Specified by:
getSourceIdsFromSink
in interfaceNodeAssociationStore
-