Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2018-08-17 13:49:23 -0400
committerRyan D. Brooks2018-08-29 14:48:57 -0400
commit62d7056c6cd26a70d8d0e2c01c4a7c5349a605cf (patch)
tree59091651a22012a4ae58ae2a88aa8477ecb797b4
parent107d15147715d05e5bb43c05694f04651d126e99 (diff)
downloadorg.eclipse.osee-62d7056c6cd26a70d8d0e2c01c4a7c5349a605cf.tar.gz
org.eclipse.osee-62d7056c6cd26a70d8d0e2c01c4a7c5349a605cf.tar.xz
org.eclipse.osee-62d7056c6cd26a70d8d0e2c01c4a7c5349a605cf.zip
refactor: Use RelationTypeToken in relation creation
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationDataFactory.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationFactory.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationManager.java9
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java9
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImpl.java11
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java11
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java13
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/DataModuleFactory.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoaderModule.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectFactoryImpl.java16
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationObjectFactory.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsCollectorWriter.java6
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/transaction/TransactionBuilder.java11
14 files changed, 67 insertions, 45 deletions
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationDataFactory.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationDataFactory.java
index 4a542dc767c..ceabd08acd3 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationDataFactory.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationDataFactory.java
@@ -12,14 +12,14 @@ package org.eclipse.osee.orcs.core.ds;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
-import org.eclipse.osee.framework.core.data.RelationTypeId;
+import org.eclipse.osee.framework.core.data.RelationTypeToken;
/**
* @author Roberto E. Escobar
*/
public interface RelationDataFactory {
- RelationData createRelationData(RelationTypeId relationType, BranchId branch, ArtifactId aArtifact, ArtifactId bArtifact, String rationale);
+ RelationData createRelationData(RelationTypeToken relationType, BranchId branch, ArtifactId aArtifact, ArtifactId bArtifact, String rationale);
RelationData clone(RelationData source);
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationFactory.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationFactory.java
index 41ee53c190e..1337ea03e92 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationFactory.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationFactory.java
@@ -11,7 +11,7 @@
package org.eclipse.osee.orcs.core.internal.relation;
import org.eclipse.osee.framework.core.data.BranchId;
-import org.eclipse.osee.framework.core.data.RelationTypeId;
+import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.orcs.core.ds.RelationData;
import org.eclipse.osee.orcs.core.ds.RelationDataFactory;
import org.eclipse.osee.orcs.core.internal.artifact.Artifact;
@@ -40,11 +40,11 @@ public class RelationFactory {
return new Relation(relationTypes, data);
}
- public Relation createRelation(Artifact aNode, RelationTypeId type, Artifact bNode) {
+ public Relation createRelation(Artifact aNode, RelationTypeToken type, Artifact bNode) {
return createRelation(aNode, type, bNode, "");
}
- public Relation createRelation(Artifact aNode, RelationTypeId type, Artifact bNode, String rationale) {
+ public Relation createRelation(Artifact aNode, RelationTypeToken type, Artifact bNode, String rationale) {
OrcsConditions.checkBranch(aNode, bNode);
OrcsConditions.checkRelateSelf(aNode, bNode);
RelationData data = relationDataFactory.createRelationData(type, aNode.getBranch(), aNode, bNode, rationale);
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationManager.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationManager.java
index 6c9e14d2110..9d2dc5b3ea6 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationManager.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationManager.java
@@ -15,6 +15,7 @@ import java.util.List;
import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.RelationTypeId;
+import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.core.enums.RelationSide;
import org.eclipse.osee.framework.core.enums.RelationSorter;
@@ -66,13 +67,13 @@ public interface RelationManager {
void addChild(OrcsSession session, Artifact parent, Artifact child);
- void relate(OrcsSession session, Artifact aNode, RelationTypeId type, Artifact bNode);
+ void relate(OrcsSession session, Artifact aNode, RelationTypeToken type, Artifact bNode);
- void relate(OrcsSession session, Artifact aNode, RelationTypeId type, Artifact bNode, String rationale);
+ void relate(OrcsSession session, Artifact aNode, RelationTypeToken type, Artifact bNode, String rationale);
- void relate(OrcsSession session, Artifact aNode, RelationTypeId type, Artifact bNode, RelationSorter sortType);
+ void relate(OrcsSession session, Artifact aNode, RelationTypeToken type, Artifact bNode, RelationSorter sortType);
- void relate(OrcsSession session, Artifact aNode, RelationTypeId type, Artifact bNode, String rationale, RelationSorter sortType);
+ void relate(OrcsSession session, Artifact aNode, RelationTypeToken type, Artifact bNode, String rationale, RelationSorter sortType);
void setRationale(OrcsSession session, Artifact aNode, RelationTypeId type, Artifact bNode, String rationale);
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java
index 87886c35df7..922a16027dc 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java
@@ -38,6 +38,7 @@ import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.RelationTypeId;
import org.eclipse.osee.framework.core.data.RelationTypeSide;
+import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.core.enums.RelationSide;
import org.eclipse.osee.framework.core.enums.RelationSorter;
@@ -205,22 +206,22 @@ public class RelationManagerImpl implements RelationManager {
}
@Override
- public void relate(OrcsSession session, Artifact aNode, RelationTypeId type, Artifact bNode) {
+ public void relate(OrcsSession session, Artifact aNode, RelationTypeToken type, Artifact bNode) {
relate(session, aNode, type, bNode, emptyString(), PREEXISTING);
}
@Override
- public void relate(OrcsSession session, Artifact aNode, RelationTypeId type, Artifact bNode, String rationale) {
+ public void relate(OrcsSession session, Artifact aNode, RelationTypeToken type, Artifact bNode, String rationale) {
relate(session, aNode, type, bNode, rationale, PREEXISTING);
}
@Override
- public void relate(OrcsSession session, Artifact aNode, RelationTypeId type, Artifact bNode, RelationSorter sortType) {
+ public void relate(OrcsSession session, Artifact aNode, RelationTypeToken type, Artifact bNode, RelationSorter sortType) {
relate(session, aNode, type, bNode, emptyString(), sortType);
}
@Override
- public void relate(OrcsSession session, Artifact aNode, RelationTypeId type, Artifact bNode, String rationale, RelationSorter sortType) {
+ public void relate(OrcsSession session, Artifact aNode, RelationTypeToken type, Artifact bNode, String rationale, RelationSorter sortType) {
checkBranch(aNode, bNode);
checkRelateSelf(aNode, bNode);
GraphData graph = getGraph(aNode, bNode);
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImpl.java
index 6f6151a41b1..893a37e4823 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImpl.java
@@ -26,6 +26,7 @@ import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.data.RelationTypeSide;
+import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.core.data.Tuple2Type;
import org.eclipse.osee.framework.core.data.Tuple3Type;
import org.eclipse.osee.framework.core.data.Tuple4Type;
@@ -276,27 +277,27 @@ public class TransactionBuilderImpl implements TransactionBuilder {
}
@Override
- public void relate(ArtifactId artA, IRelationType relType, ArtifactId artB) {
+ public void relate(ArtifactId artA, RelationTypeToken relType, ArtifactId artB) {
txManager.relate(txData, artA, relType, artB);
}
@Override
- public void relate(ArtifactId artA, IRelationType relType, ArtifactId artB, String rationale) {
+ public void relate(ArtifactId artA, RelationTypeToken relType, ArtifactId artB, String rationale) {
txManager.relate(txData, artA, relType, artB, rationale);
}
@Override
- public void relate(ArtifactId artA, IRelationType relType, ArtifactId artB, RelationSorter sortType) {
+ public void relate(ArtifactId artA, RelationTypeToken relType, ArtifactId artB, RelationSorter sortType) {
txManager.relate(txData, artA, relType, artB, sortType);
}
@Override
- public void relate(ArtifactId artA, IRelationType relType, ArtifactId artB, String rationale, RelationSorter sortType) {
+ public void relate(ArtifactId artA, RelationTypeToken relType, ArtifactId artB, String rationale, RelationSorter sortType) {
txManager.relate(txData, artA, relType, artB, rationale, sortType);
}
@Override
- public void setRelations(ArtifactId artA, IRelationType relType, Iterable<? extends ArtifactId> artBs) {
+ public void setRelations(ArtifactId artA, RelationTypeToken relType, Iterable<? extends ArtifactId> artBs) {
txManager.setRelations(txData, artA, relType, artBs);
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java
index f98d80bf2b8..8847ee884d0 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java
@@ -26,6 +26,7 @@ import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.data.RelationTypeSide;
+import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.core.data.Tuple2Type;
import org.eclipse.osee.framework.core.data.Tuple3Type;
import org.eclipse.osee.framework.core.data.Tuple4Type;
@@ -354,31 +355,31 @@ public class TxDataManager {
relationManager.addChild(session, asArtifact, getForWrite(txData, child));
}
- public void relate(TxData txData, ArtifactId artA, IRelationType type, ArtifactId artB) {
+ public void relate(TxData txData, ArtifactId artA, RelationTypeToken type, ArtifactId artB) {
Artifact asArtifactA = getForWrite(txData, artA);
Artifact asArtifactB = getForWrite(txData, artB);
relationManager.relate(txData.getSession(), asArtifactA, type, asArtifactB);
}
- public void relate(TxData txData, ArtifactId artA, IRelationType type, ArtifactId artB, String rationale) {
+ public void relate(TxData txData, ArtifactId artA, RelationTypeToken type, ArtifactId artB, String rationale) {
Artifact asArtifactA = getForWrite(txData, artA);
Artifact asArtifactB = getForWrite(txData, artB);
relationManager.relate(txData.getSession(), asArtifactA, type, asArtifactB, rationale);
}
- public void relate(TxData txData, ArtifactId artA, IRelationType type, ArtifactId artB, RelationSorter sortType) {
+ public void relate(TxData txData, ArtifactId artA, RelationTypeToken type, ArtifactId artB, RelationSorter sortType) {
Artifact asArtifactA = getForWrite(txData, artA);
Artifact asArtifactB = getForWrite(txData, artB);
relationManager.relate(txData.getSession(), asArtifactA, type, asArtifactB, sortType);
}
- public void relate(TxData txData, ArtifactId artA, IRelationType type, ArtifactId artB, String rationale, RelationSorter sortType) {
+ public void relate(TxData txData, ArtifactId artA, RelationTypeToken type, ArtifactId artB, String rationale, RelationSorter sortType) {
Artifact asArtifactA = getForWrite(txData, artA);
Artifact asArtifactB = getForWrite(txData, artB);
relationManager.relate(txData.getSession(), asArtifactA, type, asArtifactB, rationale, sortType);
}
- public void setRelations(TxData txData, ArtifactId artA, IRelationType type, Iterable<? extends ArtifactId> artBs) {
+ public void setRelations(TxData txData, ArtifactId artA, RelationTypeToken type, Iterable<? extends ArtifactId> artBs) {
Artifact asArtifactA = getForWrite(txData, artA);
Set<Artifact> asArtifactBs = Sets.newLinkedHashSet(getForWrite(txData, artBs));
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java
index 3e9145b4bda..7dcd9182cf5 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java
@@ -21,11 +21,12 @@ import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.data.IArtifactType;
-import org.eclipse.osee.framework.core.data.RelationTypeId;
+import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.core.data.RelationalConstants;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreBranches;
+import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.util.GUID;
@@ -36,6 +37,7 @@ import org.eclipse.osee.orcs.core.ds.DataProxy;
import org.eclipse.osee.orcs.core.ds.RelationData;
import org.eclipse.osee.orcs.core.ds.VersionData;
import org.eclipse.osee.orcs.data.ArtifactTypes;
+import org.eclipse.osee.orcs.data.RelationTypes;
import org.eclipse.osee.orcs.db.internal.IdentityLocator;
import org.eclipse.osee.orcs.db.internal.IdentityManager;
import org.eclipse.osee.orcs.db.internal.OrcsObjectFactory;
@@ -69,6 +71,7 @@ public class DataFactoryImplTest {
@Mock private AttributeDataProxyFactory proxyFactory;
@Mock private IdentityLocator identityService;
@Mock private ArtifactTypes artifactCache;
+ @Mock private RelationTypes relationTypes;
@Mock private ArtifactData artData;
@Mock private AttributeData attrData;
@@ -94,7 +97,7 @@ public class DataFactoryImplTest {
guid = GUID.create();
- OrcsObjectFactory objectFactory = new OrcsObjectFactoryImpl(proxyFactory);
+ OrcsObjectFactory objectFactory = new OrcsObjectFactoryImpl(proxyFactory, relationTypes);
dataFactory = new DataFactoryImpl(idFactory, objectFactory, artifactCache);
// VERSION
@@ -250,7 +253,7 @@ public class DataFactoryImplTest {
@Test
public void testCreateRelationData() {
- RelationTypeId relationType = RelationTypeId.valueOf(2389);
+ RelationTypeToken relationType = CoreRelationTypes.Default_Hierarchical__Child;
ArtifactId aArt = ArtifactId.valueOf(4562);
ArtifactId bArt = ArtifactId.valueOf(9513);
@@ -268,9 +271,9 @@ public class DataFactoryImplTest {
Assert.assertTrue("local id must be valid", actual.getLocalId() > 0);
assertEquals(RelationalConstants.DEFAULT_MODIFICATION_TYPE, actual.getModType());
- assertEquals(2389L, actual.getTypeUuid());
+ assertEquals(relationType.getId().longValue(), actual.getTypeUuid());
assertEquals(RelationalConstants.DEFAULT_MODIFICATION_TYPE, actual.getBaseModType());
- assertEquals(2389L, actual.getBaseTypeUuid());
+ assertEquals(relationType.getId().longValue(), actual.getBaseTypeUuid());
assertEquals(aArt, actual.getArtifactIdA());
assertEquals(bArt, actual.getArtifactIdB());
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/DataModuleFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/DataModuleFactory.java
index ae26d91cc4d..b8a320804b0 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/DataModuleFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/DataModuleFactory.java
@@ -23,6 +23,7 @@ import org.eclipse.osee.orcs.core.ds.QueryEngineIndexer;
import org.eclipse.osee.orcs.core.ds.TxDataStore;
import org.eclipse.osee.orcs.data.ArtifactTypes;
import org.eclipse.osee.orcs.data.AttributeTypes;
+import org.eclipse.osee.orcs.data.RelationTypes;
import org.eclipse.osee.orcs.db.internal.branch.BranchModule;
import org.eclipse.osee.orcs.db.internal.branch.KeyValueModule;
import org.eclipse.osee.orcs.db.internal.loader.LoaderModule;
@@ -61,10 +62,11 @@ public class DataModuleFactory {
ArtifactTypes artifactTypes = orcsTypes.getArtifactTypes();
AttributeTypes attributeTypes = orcsTypes.getAttributeTypes();
+ RelationTypes relationTypes = orcsTypes.getRelationTypes();
final QueryEngineIndexer indexer = queryModule.getQueryIndexer();
final AttributeDataProxyFactory proxyFactory = loaderModule.createProxyDataFactory(attributeTypes);
- final OrcsObjectFactory objectFactory = loaderModule.createOrcsObjectFactory(proxyFactory);
+ final OrcsObjectFactory objectFactory = loaderModule.createOrcsObjectFactory(proxyFactory, relationTypes);
final DataFactory dataFactory = loaderModule.createDataFactory(objectFactory, artifactTypes);
final DynamicLoadProcessor loadProcessor = loaderModule.createDynamicLoadProcessor(orcsTypes, proxyFactory);
SqlObjectLoader sqlObjectLoader =
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java
index d2dfeb29848..69cbd5d33f7 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java
@@ -16,7 +16,7 @@ import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.data.IArtifactType;
-import org.eclipse.osee.framework.core.data.RelationTypeId;
+import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.core.data.RelationalConstants;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.data.Tuple2Type;
@@ -126,7 +126,7 @@ public class DataFactoryImpl implements DataFactory {
}
@Override
- public RelationData createRelationData(RelationTypeId relationType, BranchId branch, ArtifactId aArtifact, ArtifactId bArtifact, String rationale) {
+ public RelationData createRelationData(RelationTypeToken relationType, BranchId branch, ArtifactId aArtifact, ArtifactId bArtifact, String rationale) {
VersionData version = objectFactory.createDefaultVersionData();
version.setBranch(branch);
ModificationType modType = RelationalConstants.DEFAULT_MODIFICATION_TYPE;
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoaderModule.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoaderModule.java
index 80ffd1568e3..9f64e54aeb7 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoaderModule.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoaderModule.java
@@ -18,6 +18,7 @@ import org.eclipse.osee.orcs.core.ds.DataFactory;
import org.eclipse.osee.orcs.core.ds.DataLoaderFactory;
import org.eclipse.osee.orcs.data.ArtifactTypes;
import org.eclipse.osee.orcs.data.AttributeTypes;
+import org.eclipse.osee.orcs.data.RelationTypes;
import org.eclipse.osee.orcs.db.internal.IdentityManager;
import org.eclipse.osee.orcs.db.internal.OrcsObjectFactory;
import org.eclipse.osee.orcs.db.internal.loader.data.OrcsObjectFactoryImpl;
@@ -49,8 +50,8 @@ public class LoaderModule {
return new AttributeDataProxyFactory(attributeTypes, resourceManager, logger);
}
- public OrcsObjectFactory createOrcsObjectFactory(AttributeDataProxyFactory proxyFactory) {
- return new OrcsObjectFactoryImpl(proxyFactory);
+ public OrcsObjectFactory createOrcsObjectFactory(AttributeDataProxyFactory proxyFactory, RelationTypes relationTypes) {
+ return new OrcsObjectFactoryImpl(proxyFactory, relationTypes);
}
public DataFactory createDataFactory(OrcsObjectFactory factory, ArtifactTypes artifactTypes) {
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectFactoryImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectFactoryImpl.java
index ceb746a79c0..e657e3d5c51 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectFactoryImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectFactoryImpl.java
@@ -17,6 +17,7 @@ import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.RelationTypeId;
+import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.core.data.RelationalConstants;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.data.Tuple2Type;
@@ -32,6 +33,7 @@ import org.eclipse.osee.orcs.core.ds.DataProxy;
import org.eclipse.osee.orcs.core.ds.RelationData;
import org.eclipse.osee.orcs.core.ds.TupleData;
import org.eclipse.osee.orcs.core.ds.VersionData;
+import org.eclipse.osee.orcs.data.RelationTypes;
import org.eclipse.osee.orcs.db.internal.OrcsObjectFactory;
import org.eclipse.osee.orcs.db.internal.proxy.AttributeDataProxyFactory;
@@ -39,12 +41,12 @@ import org.eclipse.osee.orcs.db.internal.proxy.AttributeDataProxyFactory;
* @author Roberto E. Escobar
*/
public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
-
private final AttributeDataProxyFactory proxyFactory;
+ private final RelationTypes relationTypes;
- public OrcsObjectFactoryImpl(AttributeDataProxyFactory proxyFactory) {
- super();
+ public OrcsObjectFactoryImpl(AttributeDataProxyFactory proxyFactory, RelationTypes relationTypes) {
this.proxyFactory = proxyFactory;
+ this.relationTypes = relationTypes;
}
@Override
@@ -129,11 +131,17 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
}
@Override
- public RelationData createRelationData(VersionData version, Integer id, RelationTypeId relationType, ModificationType modType, ArtifactId aArtId, ArtifactId bArtId, String rationale, ApplicabilityId applicId) {
+ public RelationData createRelationData(VersionData version, Integer id, RelationTypeToken relationType, ModificationType modType, ArtifactId aArtId, ArtifactId bArtId, String rationale, ApplicabilityId applicId) {
long typeId = relationType.getId();
return createRelationData(version, id, typeId, modType, typeId, modType, aArtId, bArtId, rationale, applicId);
}
+ @Override
+ public RelationData createRelationData(VersionData version, Integer id, RelationTypeId relationType, ModificationType modType, ArtifactId aArtId, ArtifactId bArtId, String rationale, ApplicabilityId applicId) {
+ return createRelationData(version, id, relationTypes.get(relationType), modType, aArtId, bArtId, rationale,
+ applicId);
+ }
+
private ArtifactData createArtifactFromRow(VersionData version, int id, long localTypeID, ModificationType modType, long baseLocalTypeID, ModificationType baseModType, String guid, ApplicabilityId applicId) {
ArtifactData data = new ArtifactDataImpl(version);
data.setLocalId(id);
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationObjectFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationObjectFactory.java
index f1968c66d3c..3d90b50c4a0 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationObjectFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationObjectFactory.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.orcs.db.internal.loader.data;
import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.RelationTypeId;
+import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.orcs.core.ds.RelationData;
import org.eclipse.osee.orcs.core.ds.VersionData;
@@ -24,5 +25,7 @@ public interface RelationObjectFactory extends VersionObjectFactory {
RelationData createRelationData(VersionData version, Integer id, RelationTypeId relationType, ModificationType modType, ArtifactId aArtId, ArtifactId bArtId, String rationale, ApplicabilityId applicId);
+ RelationData createRelationData(VersionData version, Integer id, RelationTypeToken relationType, ModificationType modType, ArtifactId aArtId, ArtifactId bArtId, String rationale, ApplicabilityId applicId);
+
RelationData createCopy(RelationData source);
}
diff --git a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsCollectorWriter.java b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsCollectorWriter.java
index a8db710e82f..48f21d4c42b 100644
--- a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsCollectorWriter.java
+++ b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsCollectorWriter.java
@@ -20,8 +20,8 @@ import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
-import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.data.RelationTypeSide;
+import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.enums.RelationSide;
@@ -52,7 +52,7 @@ public class OrcsCollectorWriter {
private final OrcsApi orcsApi;
private Map<Long, ArtifactId> idToArtifact;
private TransactionBuilder transaction;
- private BranchId branch;
+ private final BranchId branch;
private ArtifactReadable user;
private final XResultData results;
@@ -284,7 +284,7 @@ public class OrcsCollectorWriter {
private void createMissingRelations(List<OwRelation> relations, ArtifactId artifact, XResultData results) {
for (OwRelation relation : relations) {
OwRelationType owRelType = relation.getType();
- IRelationType relType = orcsApi.getOrcsTypes().getRelationTypes().get(owRelType.getId());
+ RelationTypeToken relType = orcsApi.getOrcsTypes().getRelationTypes().get(owRelType.getId());
OwArtifactToken artToken = relation.getArtToken();
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/transaction/TransactionBuilder.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/transaction/TransactionBuilder.java
index dd73c22edec..4379750cde6 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/transaction/TransactionBuilder.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/transaction/TransactionBuilder.java
@@ -24,6 +24,7 @@ import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.data.RelationTypeSide;
+import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.core.data.Tuple2Type;
import org.eclipse.osee.framework.core.data.Tuple3Type;
import org.eclipse.osee.framework.core.data.Tuple4Type;
@@ -124,15 +125,15 @@ public interface TransactionBuilder {
void addChild(ArtifactId parent, ArtifactId child);
- void relate(ArtifactId artA, IRelationType relType, ArtifactId artB);
+ void relate(ArtifactId artA, RelationTypeToken relType, ArtifactId artB);
- void relate(ArtifactId artA, IRelationType relType, ArtifactId artB, String rationale);
+ void relate(ArtifactId artA, RelationTypeToken relType, ArtifactId artB, String rationale);
- void relate(ArtifactId artA, IRelationType relType, ArtifactId artB, RelationSorter sortType);
+ void relate(ArtifactId artA, RelationTypeToken relType, ArtifactId artB, RelationSorter sortType);
- void relate(ArtifactId artA, IRelationType relType, ArtifactId artB, String rationale, RelationSorter sortType);
+ void relate(ArtifactId artA, RelationTypeToken relType, ArtifactId artB, String rationale, RelationSorter sortType);
- void setRelations(ArtifactId artA, IRelationType relType, Iterable<? extends ArtifactId> artBs);
+ void setRelations(ArtifactId artA, RelationTypeToken relType, Iterable<? extends ArtifactId> artBs);
void setRationale(ArtifactId artA, IRelationType relType, ArtifactId artB, String rationale);

Back to the top