Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbrooks2010-10-07 22:22:35 +0000
committerRyan D. Brooks2010-10-07 22:22:35 +0000
commit41a747cb6b391a989054c014460bdc34040594bf (patch)
tree7585e8fe5b21fd9a107c4e6fa07607314eec55f9 /plugins/org.eclipse.osee.framework.core.datastore
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.datastore')
-rw-r--r--plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/cache/DatabaseRelationTypeAccessor.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/cache/DatabaseRelationTypeAccessor.java b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/cache/DatabaseRelationTypeAccessor.java
index afdabec5a0e..4402e3ff5dc 100644
--- a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/cache/DatabaseRelationTypeAccessor.java
+++ b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/cache/DatabaseRelationTypeAccessor.java
@@ -38,18 +38,18 @@ public class DatabaseRelationTypeAccessor extends AbstractDatabaseAccessor<Relat
private static final String UPDATE_RELATION_TYPE =
"update osee_relation_link_type SET type_name=?, a_name=?, b_name=?, a_art_type_id=?, b_art_type_id=?, multiplicity=?, default_order_type_guid=? where rel_link_type_id = ?";
- private final ArtifactTypeCache artifactCache;
+ private final ArtifactTypeCache artifactTypeCache;
private final RelationTypeFactory factory;
public DatabaseRelationTypeAccessor(IOseeDatabaseService databaseService, ArtifactTypeCache artifactCache, RelationTypeFactory factory) {
super(databaseService);
- this.artifactCache = artifactCache;
+ this.artifactTypeCache = artifactCache;
this.factory = factory;
}
@Override
public void load(IOseeCache<RelationType> cache) throws OseeCoreException {
- artifactCache.ensurePopulated();
+ artifactTypeCache.ensurePopulated();
IOseeStatement chStmt = getDatabaseService().getStatement();
try {
@@ -62,8 +62,8 @@ public class DatabaseRelationTypeAccessor extends AbstractDatabaseAccessor<Relat
int bArtTypeId = chStmt.getInt("b_art_type_id");
int multiplicityValue = chStmt.getInt("multiplicity");
try {
- IArtifactType artifactTypeSideA = artifactCache.getById(aArtTypeId);
- IArtifactType artifactTypeSideB = artifactCache.getById(bArtTypeId);
+ IArtifactType artifactTypeSideA = artifactTypeCache.getById(aArtTypeId);
+ IArtifactType artifactTypeSideB = artifactTypeCache.getById(bArtTypeId);
RelationTypeMultiplicity multiplicity =
RelationTypeMultiplicity.getRelationMultiplicity(multiplicityValue);
String sideAName = chStmt.getString("a_name");
@@ -119,26 +119,26 @@ public class DatabaseRelationTypeAccessor extends AbstractDatabaseAccessor<Relat
}
}
- private Object[] toInsertValues(RelationType type) {
+ private Object[] toInsertValues(RelationType type) throws OseeCoreException {
return new Object[] {
type.getId(),
type.getGuid(),
type.getName(),
type.getSideAName(),
type.getSideBName(),
- type.getArtifactTypeSideA().getId(),
- type.getArtifactTypeSideB().getId(),
+ artifactTypeCache.get(type.getArtifactTypeSideA()).getId(),
+ artifactTypeCache.get(type.getArtifactTypeSideB()).getId(),
type.getMultiplicity().getValue(),
type.getDefaultOrderTypeGuid()};
}
- private Object[] toUpdateValues(RelationType type) {
+ private Object[] toUpdateValues(RelationType type) throws OseeCoreException {
return new Object[] {
type.getName(),
type.getSideAName(),
type.getSideBName(),
- type.getArtifactTypeSideA().getId(),
- type.getArtifactTypeSideB().getId(),
+ artifactTypeCache.get(type.getArtifactTypeSideA()).getId(),
+ artifactTypeCache.get(type.getArtifactTypeSideB()).getId(),
type.getMultiplicity().getValue(),
type.getDefaultOrderTypeGuid(),
type.getId()};

Back to the top