public class NodeAssociationStoreImpl extends Object implements NodeAssociationStore
| Constructor and Description |
|---|
NodeAssociationStoreImpl(OfBizDelegator ofBizDelegator) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
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 |
getAssociation(org.ofbiz.core.entity.GenericValue source,
org.ofbiz.core.entity.GenericValue sink,
String associationType) |
List<Long> |
getSinkIdsFromSource(org.ofbiz.core.entity.GenericValue source,
String sinkEntityName,
String associationType) |
List<Long> |
getSinkIdsFromSource(NodeAssocationType nodeAssocationType,
Long sourceNodeId) |
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 source
|
List<org.ofbiz.core.entity.GenericValue> |
getSinksFromSource(String sourceEntityName,
Long sourceNodeId,
String sinkEntityName,
String associationType) |
List<Long> |
getSourceIdsFromSink(org.ofbiz.core.entity.GenericValue sink,
String sourceEntity,
String associationType) |
List<Long> |
getSourceIdsFromSink(NodeAssocationType nodeAssocationType,
Long sinkNodeId) |
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 sink
|
void |
removeAllAssociationsFromSource(String entityName,
Long sourceId)
Remove all entity<->entity associations, given the source.
|
void |
removeAssociation(org.ofbiz.core.entity.GenericValue source,
org.ofbiz.core.entity.GenericValue sink,
String associationType) |
void |
removeAssociation(NodeAssocationType type,
Long sourceNodeId,
Long sinkNodeId)
Removes the given association if it exists.
|
void |
removeAssociationsFromSink(org.ofbiz.core.entity.GenericValue sink)
Remove all entity<->entity associations, given the sink.
|
void |
removeAssociationsFromSource(org.ofbiz.core.entity.GenericValue source)
Remove all entity<->entity associations, given the source.
|
void |
removeAssociationsFromSource(NodeAssocationType nodeAssocationType,
Long sourceNodeId)
Remove associations of the given type from the given source.
|
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)
|
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.
|
public NodeAssociationStoreImpl(OfBizDelegator ofBizDelegator)
public List<org.ofbiz.core.entity.GenericValue> getSinksFromSource(org.ofbiz.core.entity.GenericValue source, String sinkEntityName, String associationType) throws DataAccessException
NodeAssociationStoregetSinksFromSource in interface NodeAssociationStoresource - The source node to find all associated sink nodes for.sinkEntityName - The sink Entity type.associationType - the association typeDataAccessException - If there is a DB Exception.public List<org.ofbiz.core.entity.GenericValue> getSinksFromSource(String sourceEntityName, Long sourceNodeId, String sinkEntityName, String associationType)
getSinksFromSource in interface NodeAssociationStorepublic List<org.ofbiz.core.entity.GenericValue> getSourcesFromSink(org.ofbiz.core.entity.GenericValue sink, String sourceName, String associationType) throws DataAccessException
NodeAssociationStoregetSourcesFromSink in interface NodeAssociationStoreDataAccessException - If there is a DB Exception.public org.ofbiz.core.entity.GenericValue createAssociation(org.ofbiz.core.entity.GenericValue source,
org.ofbiz.core.entity.GenericValue sink,
String associationType)
throws DataAccessException
If the association already exists - it will not be created.
createAssociation in interface NodeAssociationStoresource - the sourcesink - the sinkassociationType - the Association TypeDataAccessException - If there is a DB Exception.public void createAssociation(NodeAssocationType type, Long sourceNodeId, Long sinkNodeId)
NodeAssociationStoreIf the association already exists - it will not be created.
createAssociation in interface NodeAssociationStorepublic org.ofbiz.core.entity.GenericValue createAssociation(String sourceNodeEntity, Long sourceNodeId, String sinkNodeEntity, Long sinkNodeId, String associationType) throws DataAccessException
NodeAssociationStoreIf 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.
createAssociation in interface NodeAssociationStoreDataAccessException - If there is a DB Exception.public void removeAssociation(NodeAssocationType type, Long sourceNodeId, Long sinkNodeId)
NodeAssociationStoreremoveAssociation in interface NodeAssociationStoretype - NodeAssocation TypesourceNodeId - The Source NodesinkNodeId - The Sink Node (destination node).public void removeAssociation(org.ofbiz.core.entity.GenericValue source,
org.ofbiz.core.entity.GenericValue sink,
String associationType)
throws DataAccessException
removeAssociation in interface NodeAssociationStoreDataAccessExceptionpublic void removeAssociationsFromSource(org.ofbiz.core.entity.GenericValue source)
throws DataAccessException
NodeAssociationStoreremoveAssociationsFromSource in interface NodeAssociationStoresource - the SourceDataAccessExceptionNodeAssociationStore.removeAllAssociationsFromSource(String, Long)public void removeAllAssociationsFromSource(String entityName, Long sourceId)
NodeAssociationStoreremoveAllAssociationsFromSource in interface NodeAssociationStoreentityName - the Source entity namesourceId - the Source IDNodeAssociationStore.removeAssociationsFromSource(org.ofbiz.core.entity.GenericValue),
NodeAssociationStore.removeAssociationsFromSource(NodeAssocationType, Long)public void removeAssociationsFromSource(NodeAssocationType nodeAssocationType, Long sourceNodeId)
NodeAssociationStoreremoveAssociationsFromSource in interface NodeAssociationStorenodeAssocationType - the NodeAssocationTypesourceNodeId - the ID of the sourcepublic void removeAssociationsFromSink(org.ofbiz.core.entity.GenericValue sink)
throws DataAccessException
NodeAssociationStoreremoveAssociationsFromSink in interface NodeAssociationStoresink - the sinkDataAccessException - If there is a DB Exception.public void swapAssociation(String sourceEntityName, String associationType, org.ofbiz.core.entity.GenericValue fromSink, org.ofbiz.core.entity.GenericValue toSink) throws DataAccessException
NodeAssociationStoreUsed in ComponentDelete and VersionDelete.
swapAssociation in interface NodeAssociationStoresourceEntityName - the Source Entity TypeassociationType - the Association TypefromSink - the From sinktoSink - the To sinkDataAccessException - If there is a DB Exception.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
NodeAssociationStoreswapAssociation in interface NodeAssociationStoreentities - the entitiesassociationType - the Association TypefromSink - the From sinktoSink - the To sinkDataAccessException - If there is a DB Exception.public org.ofbiz.core.entity.GenericValue getAssociation(org.ofbiz.core.entity.GenericValue source,
org.ofbiz.core.entity.GenericValue sink,
String associationType)
throws DataAccessException
getAssociation in interface NodeAssociationStoreDataAccessExceptionpublic List<Long> getSinkIdsFromSource(org.ofbiz.core.entity.GenericValue source, String sinkEntityName, String associationType)
getSinkIdsFromSource in interface NodeAssociationStorepublic List<Long> getSinkIdsFromSource(NodeAssocationType nodeAssocationType, Long sourceNodeId)
getSinkIdsFromSource in interface NodeAssociationStorepublic List<Long> getSourceIdsFromSink(org.ofbiz.core.entity.GenericValue sink, String sourceEntity, String associationType)
getSourceIdsFromSink in interface NodeAssociationStorepublic List<Long> getSourceIdsFromSink(NodeAssocationType nodeAssocationType, Long sinkNodeId)
getSourceIdsFromSink in interface NodeAssociationStoreCopyright © 2002-2021 Atlassian. All Rights Reserved.