Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbrooks2010-10-07 18:22:35 -0400
committerRyan D. Brooks2010-10-07 18:22:35 -0400
commit41a747cb6b391a989054c014460bdc34040594bf (patch)
tree7585e8fe5b21fd9a107c4e6fa07607314eec55f9 /plugins/org.eclipse.osee.framework.core.message/src/org
parenta0e7caf87b82af58e532cd1f24dd600792a0dadb (diff)
downloadorg.eclipse.osee-41a747cb6b391a989054c014460bdc34040594bf.tar.gz
org.eclipse.osee-41a747cb6b391a989054c014460bdc34040594bf.tar.xz
org.eclipse.osee-41a747cb6b391a989054c014460bdc34040594bf.zip
bug: Fix relation type cache to work with artifact type token changes
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.message/src/org')
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/RelationTypeCacheUpdateResponse.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/RelationTypeCacheUpdateResponse.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/RelationTypeCacheUpdateResponse.java
index ad28a4e85c..974ad9d240 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/RelationTypeCacheUpdateResponse.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/RelationTypeCacheUpdateResponse.java
@@ -15,7 +15,10 @@ import java.util.Collection;
import java.util.List;
import org.eclipse.osee.framework.core.enums.RelationTypeMultiplicity;
import org.eclipse.osee.framework.core.enums.StorageState;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.cache.ArtifactTypeCache;
import org.eclipse.osee.framework.core.model.type.RelationType;
+import org.eclipse.osee.framework.core.services.IOseeCachingService;
/**
* @author Roberto E. Escobar
@@ -137,12 +140,18 @@ public class RelationTypeCacheUpdateResponse {
}
}
- public static RelationTypeCacheUpdateResponse fromCache(Collection<RelationType> types) {
+ public static RelationTypeCacheUpdateResponse fromCache(IOseeCachingService caching) throws OseeCoreException {
+ Collection<RelationType> relationTypes = caching.getRelationTypeCache().getAll();
+ ArtifactTypeCache artifactTypeCache = caching.getArtifactTypeCache();
+
List<RelationTypeRow> rows = new ArrayList<RelationTypeRow>();
- for (RelationType item : types) {
+ for (RelationType item : relationTypes) {
+ int artifactTypeSideA = artifactTypeCache.get(item.getArtifactTypeSideA()).getId();
+ int artifactTypeSideB = artifactTypeCache.get(item.getArtifactTypeSideB()).getId();
+
rows.add(new RelationTypeRow(item.getId(), item.getName(), item.getGuid(), item.getStorageState(),
- item.getSideAName(), item.getSideBName(), item.getArtifactTypeSideA().getId(),
- item.getArtifactTypeSideB().getId(), item.getMultiplicity(), item.getDefaultOrderTypeGuid()));
+ item.getSideAName(), item.getSideBName(), artifactTypeSideA, artifactTypeSideB, item.getMultiplicity(),
+ item.getDefaultOrderTypeGuid()));
}
return new RelationTypeCacheUpdateResponse(rows);
}

Back to the top