Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2018-08-19 03:41:36 -0400
committerRyan D. Brooks2018-09-05 12:26:29 -0400
commit458179dd95e1ee83a0d37f6be852c6f5661b2ab1 (patch)
tree2ea8079f9afd8d85e917e0be4b5f081bc8133de8
parent22e105c25fe865767d13e8db67931b1f300b081c (diff)
downloadorg.eclipse.osee-458179dd95e1ee83a0d37f6be852c6f5661b2ab1.tar.gz
org.eclipse.osee-458179dd95e1ee83a0d37f6be852c6f5661b2ab1.tar.xz
org.eclipse.osee-458179dd95e1ee83a0d37f6be852c6f5661b2ab1.zip
refactor: Use Id with OrcsData
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/OrcsMockUtility.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactoryTest.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java27
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactoryTest.java21
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTest.java27
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/ArtifactData.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/ArtifactDataImpl.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/Attribute.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/AttributeData.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/HasOrcsData.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsData.java11
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsVersionedObjectImpl.java32
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationData.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/TupleData.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/OrcsApiImpl.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/Artifact.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactory.java8
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/primitives/AttributeImpl.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImpl.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/Relation.java16
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationFactory.java8
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java96
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java31
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/DataModuleFactory.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryImpl.java24
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoaderModule.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/ArtifactObjectFactory.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeDataImpl.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectFactoryImpl.java75
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationDataImpl.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/TupleDataImpl.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/DynamicLoadProcessor.java11
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/proxy/AttributeDataProxyFactory.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/util/AttributeDataMatcher.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionIndexer.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderImpl.java6
41 files changed, 219 insertions, 270 deletions
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/OrcsMockUtility.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/OrcsMockUtility.java
index ee4325f519..0a37ae3683 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/OrcsMockUtility.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/OrcsMockUtility.java
@@ -51,7 +51,7 @@ public class OrcsMockUtility {
version.setBranch(branch);
ArtifactData artifactData = new ArtifactDataImpl(version);
- artifactData.setTypeUuid(artifactType.getId());
+ artifactData.setType(artifactType);
artifactData.setLocalId(artifactId.intValue());
artifactData.setModType(ModificationType.NEW);
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactoryTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactoryTest.java
index f4a6a5e092..af64a1778e 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactoryTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactoryTest.java
@@ -94,7 +94,7 @@ public class ArtifactFactoryTest {
when(artifactData.getLocalId()).thenReturn(45);
when(artifactData.getGuid()).thenReturn(guid);
- when(artifactData.getTypeUuid()).thenReturn(Artifact.getId());
+ when(artifactData.getType()).thenReturn(Artifact);
when(artifactData.getVersion()).thenReturn(artifactVersion);
when(artifactVersion.getBranch()).thenReturn(COMMON);
when(source.getOrcsData()).thenReturn(artifactData);
@@ -103,7 +103,7 @@ public class ArtifactFactoryTest {
when(otherArtifactData.getLocalId()).thenReturn(45);
when(otherArtifactData.getGuid()).thenReturn(guid);
- when(otherArtifactData.getTypeUuid()).thenReturn(Artifact.getId());
+ when(otherArtifactData.getType()).thenReturn(Artifact);
when(otherArtifactData.getVersion()).thenReturn(artifactVersion);
// TODO RDB: make this line unnecessary
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java
index c5c3b2b4cd..6fbedd9b51 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java
@@ -99,7 +99,7 @@ public class ArtifactTest {
when(artifactData.getGuid()).thenReturn(guid);
when(artifactData.getVersion()).thenReturn(version);
- when(artifactData.getTypeUuid()).thenReturn(artifactType.getGuid());
+ when(artifactData.getType()).thenReturn(artifactType);
when(artifactData.getLocalId()).thenReturn(0);
when(deleted.getModificationType()).thenReturn(ModificationType.ARTIFACT_DELETED);
@@ -127,7 +127,7 @@ public class ArtifactTest {
}
@Test
- @SuppressWarnings({"rawtypes", "unchecked"})
+ @SuppressWarnings("rawtypes")
public void testAddException() {
Attribute one = mock(Attribute.class);
Attribute two = mock(Attribute.class);
@@ -180,12 +180,6 @@ public class ArtifactTest {
}
@Test
- public void testArtifactType() {
- artifact.getArtifactTypeId();
- verify(types).get(artifactData.getTypeUuid());
- }
-
- @Test
@SuppressWarnings({"rawtypes", "unchecked"})
public void testSetName() {
Attribute attr = mock(Attribute.class);
@@ -201,7 +195,7 @@ public class ArtifactTest {
artifact.setArtifactType(CoreArtifactTypes.CodeUnit);
- verify(artifactData).setTypeUuid(CoreArtifactTypes.CodeUnit.getGuid());
+ verify(artifactData).setType(CoreArtifactTypes.CodeUnit);
verify(artifactData).setModType(ModificationType.MODIFIED);
reset(version);
@@ -210,7 +204,7 @@ public class ArtifactTest {
when(artifactData.getVersion()).thenReturn(version);
when(artifactData.getGuid()).thenReturn(guid);
when(artifactData.getVersion()).thenReturn(version);
- when(artifactData.getTypeUuid()).thenReturn(artifactType.getGuid());
+ when(artifactData.getType()).thenReturn(artifactType);
artifact.setArtifactType(CoreArtifactTypes.CodeUnit);
verify(artifactData, never()).setModType(ModificationType.MODIFIED);
@@ -224,7 +218,7 @@ public class ArtifactTest {
}
@Test
- @SuppressWarnings({"rawtypes", "unchecked"})
+ @SuppressWarnings("rawtypes")
public void testIsDirty() {
Assert.assertFalse(artifact.isDirty());
@@ -270,7 +264,7 @@ public class ArtifactTest {
}
@Test
- @SuppressWarnings({"rawtypes", "unchecked"})
+ @SuppressWarnings("rawtypes")
public void testSetAttributesNotDirty() {
Attribute one = mock(Attribute.class);
Attribute two = mock(Attribute.class);
@@ -328,7 +322,6 @@ public class ArtifactTest {
}
@Test
- @SuppressWarnings("unchecked")
public void testGetAttributeCount() {
artifact.add(CoreAttributeTypes.AccessContextId, notDeleted);
artifact.add(CoreAttributeTypes.AccessContextId, deleted);
@@ -340,7 +333,6 @@ public class ArtifactTest {
}
@Test
- @SuppressWarnings("unchecked")
public void testGetAttributes() {
artifact.add(CoreAttributeTypes.AccessContextId, notDeleted);
artifact.add(CoreAttributeTypes.AccessContextId, deleted);
@@ -356,7 +348,6 @@ public class ArtifactTest {
}
@Test
- @SuppressWarnings("unchecked")
public void testGetAttributeValues() {
artifact.add(CoreAttributeTypes.AccessContextId, notDeleted);
artifact.add(CoreAttributeTypes.AccessContextId, deleted);
@@ -368,7 +359,6 @@ public class ArtifactTest {
}
@Test
- @SuppressWarnings("unchecked")
public void testGetSoleAttributeAsString() {
when(notDeleted.getValue()).thenReturn(new Integer(5));
artifact.add(CoreAttributeTypes.AccessContextId, notDeleted);
@@ -380,7 +370,7 @@ public class ArtifactTest {
}
@Test
- @SuppressWarnings({"rawtypes", "unchecked"})
+ @SuppressWarnings("rawtypes")
public void testGetSoleAttributeAsStringException() {
Attribute one = mock(Attribute.class);
Attribute two = mock(Attribute.class);
@@ -393,7 +383,6 @@ public class ArtifactTest {
}
@Test
- @SuppressWarnings("unchecked")
public void testDeleteAttributesByArtifact() {
artifact.add(CoreAttributeTypes.AccessContextId, notDeleted);
artifact.add(CoreAttributeTypes.AccessContextId, deleted);
@@ -405,7 +394,6 @@ public class ArtifactTest {
}
@Test
- @SuppressWarnings("unchecked")
public void testDeleteSoleAttribute() {
when(attributeFactory.getMinOccurrenceLimit(attributeType)).thenReturn(0);
when(notDeleted.getContainer()).thenReturn(artifact);
@@ -415,7 +403,6 @@ public class ArtifactTest {
}
@Test
- @SuppressWarnings("unchecked")
public void testDeleteSoleAttributeException() {
when(attributeFactory.getMinOccurrenceLimit(attributeType)).thenReturn(1);
artifact.add(attributeType, notDeleted);
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactoryTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactoryTest.java
index 72cd82780c..923b2b9f32 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactoryTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactoryTest.java
@@ -22,7 +22,6 @@ import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
-import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.orcs.core.ds.ArtifactData;
import org.eclipse.osee.orcs.core.ds.Attribute;
import org.eclipse.osee.orcs.core.ds.AttributeData;
@@ -72,30 +71,20 @@ public class AttributeFactoryTest {
factory = new AttributeFactory(dataFactory, cache);
- when(attributeData.getTypeUuid()).thenReturn(attributeType.getId());
+ when(attributeData.getType()).thenReturn(attributeType);
when(cache.get(attributeType.getId())).thenReturn(attributeType);
when(cache.getBaseAttributeTypeId(attributeType)).thenReturn("StringAttribute");
when(attributeData.getDataProxy()).thenReturn(proxy);
}
- @Test
- public void testCreateAttributeNullType() {
- when(cache.get(attributeType.getId())).thenReturn(null);
-
- thrown.expect(OseeArgumentException.class);
- thrown.expectMessage(
- "attributeType cannot be null - Cannot find attribute type with uuid[" + attributeType.getId() + "]");
- factory.createAttribute(container, attributeData);
- }
-
- @SuppressWarnings({"unchecked", "rawtypes"})
+ @SuppressWarnings("unchecked")
@Test
public void testCreateAttribute() {
Attribute<Object> actual = factory.createAttribute(container, attributeData);
assertEquals(attribute.getId(), actual.getId());
}
- @SuppressWarnings({"unchecked", "rawtypes"})
+ @SuppressWarnings("rawtypes")
@Test
public void testCreateAttributeFromArtifactDataAndType() {
ArtifactData artifactData = mock(ArtifactData.class);
@@ -120,7 +109,7 @@ public class AttributeFactoryTest {
AttributeData copiedAttributeData = mock(AttributeData.class);
when(dataFactory.copy(COMMON, attributeData)).thenReturn(copiedAttributeData);
- when(copiedAttributeData.getTypeUuid()).thenReturn(attributeType.getId());
+ when(copiedAttributeData.getType()).thenReturn(attributeType);
when(copiedAttributeData.getDataProxy()).thenReturn(proxy);
Attribute<Object> actual = factory.copyAttribute(attributeData, COMMON, container);
@@ -148,7 +137,7 @@ public class AttributeFactoryTest {
when(attributeData.getLocalId()).thenReturn(12345);
when(dataFactory.introduce(COMMON, attributeData)).thenReturn(introducedAttributeData);
- when(introducedAttributeData.getTypeUuid()).thenReturn(attributeType.getId());
+ when(introducedAttributeData.getType()).thenReturn(attributeType);
when(introducedAttributeData.getDataProxy()).thenReturn(proxy);
when(container.getAttributeById(attributeData, DeletionFlag.INCLUDE_DELETED)).thenReturn(destinationAttribute);
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTest.java
index 17e30cf34c..65d809f956 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTest.java
@@ -10,15 +10,15 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.internal.relation;
+import static org.eclipse.osee.framework.core.enums.CoreRelationTypes.Design__Design;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.RelationTypeToken;
+import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.enums.DirtyState;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.RelationSide;
@@ -37,8 +37,6 @@ import org.mockito.MockitoAnnotations;
*/
public class RelationTest {
- private static final long TYPE_UUID = 123124514L;
-
// @formatter:off
@Mock private RelationTypes relationTypes;
@Mock RelationData data;
@@ -50,9 +48,8 @@ public class RelationTest {
public void init() {
MockitoAnnotations.initMocks(this);
- relation = new Relation(relationTypes, data);
-
- when(data.getTypeUuid()).thenReturn(TYPE_UUID);
+ relation = new Relation(data);
+ when(data.getType()).thenReturn(Design__Design);
}
@Test
@@ -84,13 +81,6 @@ public class RelationTest {
}
@Test
- public void testGetRelationType() {
- relation.getRelationType();
-
- verify(relationTypes).get(TYPE_UUID);
- }
-
- @Test
public void testGetModificationType() {
relation.getModificationType();
verify(data).getModType();
@@ -142,13 +132,8 @@ public class RelationTest {
@Test
public void testIsOfType() {
- RelationTypeToken type1 = mock(RelationTypeToken.class);
- RelationTypeToken type2 = mock(RelationTypeToken.class);
-
- when(relationTypes.get(TYPE_UUID)).thenReturn(type1);
-
- assertTrue(relation.isOfType(type1));
- assertFalse(relation.isOfType(type2));
+ assertTrue(relation.isOfType(Design__Design));
+ assertFalse(relation.isOfType(CoreRelationTypes.DEFAULT_HIERARCHY));
}
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/ArtifactData.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/ArtifactData.java
index 853e4b32ab..e4caa65f4b 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/ArtifactData.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/ArtifactData.java
@@ -11,11 +11,12 @@
package org.eclipse.osee.orcs.core.ds;
import org.eclipse.osee.framework.core.data.ArtifactToken;
+import org.eclipse.osee.framework.core.data.IArtifactType;
/**
* @author Roberto E. Escobar
*/
-public interface ArtifactData extends OrcsData, ArtifactToken {
+public interface ArtifactData extends OrcsData<IArtifactType>, ArtifactToken {
void setGuid(String guid);
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/ArtifactDataImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/ArtifactDataImpl.java
index 8125c294d9..8e03a12615 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/ArtifactDataImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/ArtifactDataImpl.java
@@ -11,12 +11,13 @@
package org.eclipse.osee.orcs.core.ds;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.RelationalConstants;
/**
* @author Roberto E. Escobar
*/
-public class ArtifactDataImpl extends OrcsVersionedObjectImpl implements ArtifactData {
+public class ArtifactDataImpl extends OrcsVersionedObjectImpl<IArtifactType> implements ArtifactData {
private String guid = RelationalConstants.DEFAULT_GUID;
private boolean useBackingData = false;
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/Attribute.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/Attribute.java
index 3e73450368..05a3e538ea 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/Attribute.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/Attribute.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.orcs.core.ds;
import java.io.InputStream;
import java.lang.ref.Reference;
import org.eclipse.osee.framework.core.data.ArtifactToken;
+import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.orcs.core.internal.attribute.AttributeContainer;
import org.eclipse.osee.orcs.core.internal.util.OrcsWriteable;
import org.eclipse.osee.orcs.data.AttributeReadable;
@@ -22,7 +23,7 @@ import org.eclipse.osee.orcs.data.AttributeTypes;
* @author Roberto E. Escobar
* @author Andrew M. Finkbeiner
*/
-public interface Attribute<T> extends OrcsWriteable, AttributeReadable<T>, HasOrcsData<AttributeData<T>> {
+public interface Attribute<T> extends OrcsWriteable, AttributeReadable<T>, HasOrcsData<AttributeTypeToken, AttributeData<T>> {
void setValue(T value);
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/AttributeData.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/AttributeData.java
index dec528c7c5..858ecd0652 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/AttributeData.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/AttributeData.java
@@ -12,11 +12,12 @@ package org.eclipse.osee.orcs.core.ds;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.AttributeId;
+import org.eclipse.osee.framework.core.data.AttributeTypeToken;
/**
* @author Roberto E. Escobar
*/
-public interface AttributeData<T> extends OrcsData, AttributeId {
+public interface AttributeData<T> extends OrcsData<AttributeTypeToken>, AttributeId {
ArtifactId getArtifactId();
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/HasOrcsData.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/HasOrcsData.java
index 8874f4de23..fe25d1ae88 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/HasOrcsData.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/HasOrcsData.java
@@ -10,10 +10,12 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.ds;
+import org.eclipse.osee.framework.jdk.core.type.Id;
+
/**
* @author John Misinco
*/
-public interface HasOrcsData<T extends OrcsData> {
+public interface HasOrcsData<S extends Id, T extends OrcsData<S>> {
T getOrcsData();
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsData.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsData.java
index 481dc31e7b..21aef15f7c 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsData.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsData.java
@@ -13,20 +13,21 @@ package org.eclipse.osee.orcs.core.ds;
import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.enums.DirtyState;
import org.eclipse.osee.framework.core.enums.ModificationType;
+import org.eclipse.osee.framework.jdk.core.type.Id;
-public interface OrcsData extends HasVersion {
+public interface OrcsData<T extends Id> extends HasVersion {
void setLocalId(Integer localId);
Integer getLocalId();
- long getTypeUuid();
+ T getType();
- void setTypeUuid(long typeUuid);
+ void setType(T type);
- long getBaseTypeUuid();
+ T getBaseType();
- void setBaseTypeUuid(long originalTypeUuid);
+ void setBaseType(T originalType);
ModificationType getModType();
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsVersionedObjectImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsVersionedObjectImpl.java
index 5c8af6b0f8..992041d3e2 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsVersionedObjectImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsVersionedObjectImpl.java
@@ -19,10 +19,10 @@ import org.eclipse.osee.framework.jdk.core.type.Id;
/**
* @author Roberto E. Escobar
*/
-public abstract class OrcsVersionedObjectImpl implements OrcsData {
+public abstract class OrcsVersionedObjectImpl<T extends Id> implements OrcsData<T> {
private Integer localId = Id.SENTINEL.intValue();
- private long typeUuid = RelationalConstants.DEFAULT_TYPE_UUID;
- private long baseTypeUuid = RelationalConstants.DEFAULT_TYPE_UUID;
+ private T type;
+ private T baseType;
private ModificationType baseModType = RelationalConstants.DEFAULT_MODIFICATION_TYPE;
private ModificationType previousModType = RelationalConstants.DEFAULT_MODIFICATION_TYPE;
@@ -40,23 +40,23 @@ public abstract class OrcsVersionedObjectImpl implements OrcsData {
}
@Override
- public long getTypeUuid() {
- return typeUuid;
+ public T getType() {
+ return type;
}
@Override
- public void setTypeUuid(long typeUuid) {
- this.typeUuid = typeUuid;
+ public void setType(T type) {
+ this.type = type;
}
@Override
- public long getBaseTypeUuid() {
- return baseTypeUuid;
+ public T getBaseType() {
+ return baseType;
}
@Override
- public void setBaseTypeUuid(long baseTypeUuid) {
- this.baseTypeUuid = baseTypeUuid;
+ public void setBaseType(T baseType) {
+ this.baseType = baseType;
}
@Override
@@ -87,7 +87,7 @@ public abstract class OrcsVersionedObjectImpl implements OrcsData {
@Override
public boolean hasTypeUuidChange() {
- return getBaseTypeUuid() != getTypeUuid();
+ return type.notEqual(baseType);
}
@Override
@@ -148,15 +148,15 @@ public abstract class OrcsVersionedObjectImpl implements OrcsData {
@Override
public boolean equals(Object obj) {
- if (obj instanceof OrcsVersionedObjectImpl) {
- OrcsVersionedObjectImpl other = (OrcsVersionedObjectImpl) obj;
+ if (obj instanceof OrcsVersionedObjectImpl<?>) {
+ OrcsVersionedObjectImpl<?> other = (OrcsVersionedObjectImpl<?>) obj;
if (!getLocalId().equals(other.getLocalId())) {
return false;
}
if (baseModType != other.baseModType) {
return false;
}
- if (baseTypeUuid != other.baseTypeUuid) {
+ if (baseType.notEqual(other.baseType)) {
return false;
}
if (version == null) {
@@ -174,7 +174,7 @@ public abstract class OrcsVersionedObjectImpl implements OrcsData {
@Override
public String toString() {
- return "OrcsVersionedObject [" + super.toString() + ", typeUuid=" + typeUuid + ", baseTypeUuid=" + baseTypeUuid + ", modType=" + currentModType + ", previousModType=" + previousModType + ", baseModType=" + baseModType + ", version=" + version + "]";
+ return "OrcsVersionedObject [" + super.toString() + ", type=" + type + ", baseType=" + baseType + ", modType=" + currentModType + ", previousModType=" + previousModType + ", baseModType=" + baseModType + ", version=" + version + "]";
}
@Override
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationData.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationData.java
index ab8c2b7e2b..8ccedd3377 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationData.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationData.java
@@ -12,12 +12,13 @@ package org.eclipse.osee.orcs.core.ds;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.RelationId;
+import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.core.enums.RelationSide;
/**
* @author Andrew M. Finkbeiner
*/
-public interface RelationData extends OrcsData, RelationId {
+public interface RelationData extends OrcsData<RelationTypeToken>, RelationId {
ArtifactId getArtifactIdA();
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/TupleData.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/TupleData.java
index 57c9361bad..d14bb1f411 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/TupleData.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/TupleData.java
@@ -11,12 +11,13 @@
package org.eclipse.osee.orcs.core.ds;
import org.eclipse.osee.framework.core.data.TupleTypeId;
+import org.eclipse.osee.framework.core.data.TupleTypeToken;
/**
* @author Angel Avila
*/
import org.eclipse.osee.orcs.core.internal.tuple.TupleVisitor;
-public interface TupleData extends OrcsData {
+public interface TupleData extends OrcsData<TupleTypeToken> {
TupleTypeId getTupleType();
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/OrcsApiImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/OrcsApiImpl.java
index 07c1f5ee11..2fc0925016 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/OrcsApiImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/OrcsApiImpl.java
@@ -150,7 +150,7 @@ public class OrcsApiImpl implements OrcsApi {
ArtifactFactory artifactFactory =
new ArtifactFactory(module.getDataFactory(), attributeFactory, orcsTypes.getArtifactTypes());
- RelationFactory relationFactory = new RelationFactory(orcsTypes.getRelationTypes(), module.getDataFactory());
+ RelationFactory relationFactory = new RelationFactory(module.getDataFactory());
final GraphFactory graphFactory = new GraphFactoryImpl();
GraphBuilderFactory graphBuilderFactory =
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/Artifact.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/Artifact.java
index d30c4e58c0..33650860fd 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/Artifact.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/Artifact.java
@@ -24,7 +24,7 @@ import org.eclipse.osee.orcs.data.HasTransaction;
/**
* @author Megumi Telles
*/
-public interface Artifact extends AttributeManager, HasTransaction, ArtifactVisitable, HasOrcsData<ArtifactData>, OrcsWriteable, GraphNode, OrderStore {
+public interface Artifact extends AttributeManager, HasTransaction, ArtifactVisitable, HasOrcsData<IArtifactType, ArtifactData>, OrcsWriteable, GraphNode, OrderStore {
TransactionId getLastModifiedTransaction();
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java
index a91f706260..2e6252f625 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java
@@ -104,7 +104,7 @@ public class ArtifactImpl extends AttributeManagerImpl implements Artifact {
@Override
public IArtifactType getArtifactTypeId() {
- return artifactTypeCache.get(getOrcsData().getTypeUuid());
+ return getOrcsData().getType();
}
@Override
@@ -115,7 +115,7 @@ public class ArtifactImpl extends AttributeManagerImpl implements Artifact {
@Override
public void setArtifactType(IArtifactType artifactType) {
if (!isTypeEqual(artifactType)) {
- getOrcsData().setTypeUuid(artifactType.getGuid());
+ getOrcsData().setType(artifactType);
objectEditState = EditState.ARTIFACT_TYPE_MODIFIED;
if (getOrcsData().getVersion().isInStorage()) {
getOrcsData().setModType(ModificationType.MODIFIED);
@@ -214,7 +214,7 @@ public class ArtifactImpl extends AttributeManagerImpl implements Artifact {
@Override
public String toString() {
try {
- return String.format("artifact [type=[%s] guid=[%s] branch=[%s]]", getArtifactTypeId(), getGuid(),
+ return String.format("artifact [type=[%s] artifact id=[%s] branch=[%s]]", getArtifactTypeId(), getId(),
getBranch());
} catch (OseeCoreException ex) {
return Lib.exceptionToString(ex);
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactory.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactory.java
index 640d340822..fe255cea42 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactory.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactory.java
@@ -17,7 +17,6 @@ import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.core.exception.AttributeDoesNotExist;
-import org.eclipse.osee.framework.jdk.core.util.Conditions;
import org.eclipse.osee.orcs.core.ds.ArtifactData;
import org.eclipse.osee.orcs.core.ds.Attribute;
import org.eclipse.osee.orcs.core.ds.AttributeData;
@@ -59,10 +58,7 @@ public class AttributeFactory {
}
private <T> Attribute<T> createAttribute(AttributeContainer container, AttributeData<T> data, boolean isDirty, boolean createWithDefaults) {
- AttributeTypeId type = cache.get(data.getTypeUuid());
- Conditions.checkNotNull(type, "attributeType", "Cannot find attribute type with uuid[%s]", data.getTypeUuid());
-
- Attribute<T> attribute = createAttribute(type);
+ Attribute<T> attribute = createAttribute(data.getType());
DataProxy<T> proxy = data.getDataProxy();
ResourceNameResolver resolver = createResolver(attribute);
@@ -72,7 +68,7 @@ public class AttributeFactory {
Reference<AttributeContainer> artifactRef = new WeakReference<>(container);
attribute.internalInitialize(cache, artifactRef, data, isDirty, createWithDefaults);
- container.add(type, attribute);
+ container.add(data.getType(), attribute);
return attribute;
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java
index 789468a776..61b801a3fd 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java
@@ -28,6 +28,7 @@ import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.AttributeId;
import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.AttributeTypeToken;
+import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.core.enums.ModificationType;
@@ -50,7 +51,7 @@ import org.eclipse.osee.orcs.core.internal.util.OrcsPredicates;
/**
* @author Roberto E. Escobar
*/
-public abstract class AttributeManagerImpl extends BaseId implements HasOrcsData<ArtifactData>, AttributeManager, AttributeExceptionFactory, Iterable<Map.Entry<AttributeTypeId, List<Attribute<Object>>>> {
+public abstract class AttributeManagerImpl extends BaseId implements HasOrcsData<IArtifactType, ArtifactData>, AttributeManager, AttributeExceptionFactory, Iterable<Map.Entry<AttributeTypeId, List<Attribute<Object>>>> {
private final HashCollection<AttributeTypeId, Attribute<Object>> attributes;
private final String guid;
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/primitives/AttributeImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/primitives/AttributeImpl.java
index 96195ffe60..b5e5cd6163 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/primitives/AttributeImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/primitives/AttributeImpl.java
@@ -191,7 +191,7 @@ public abstract class AttributeImpl<T> implements Comparable<AttributeImpl<T>>,
*/
@Override
public AttributeTypeToken getAttributeType() {
- return attributeTypeCache.get(getOrcsData().getTypeUuid());
+ return attributeData.getType();
}
/**
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImpl.java
index 0c333ad882..9bb7e707d2 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImpl.java
@@ -14,7 +14,7 @@ import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
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.jdk.core.util.Conditions;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.core.ds.ArtifactData;
@@ -110,14 +110,13 @@ public class GraphBuilderImpl extends LoadDataHandlerAdapter implements GraphBui
if (relation == null) {
relation = relationFactory.createRelation(data);
}
- RelationTypeId relationType = RelationTypeId.valueOf(data.getTypeUuid());
+ RelationTypeToken relationType = data.getType();
aAdjacencies.add(relationType, relation);
bAdjacencies.add(relationType, relation);
}
private Relation findRelation(RelationNodeAdjacencies adjacencies, RelationData data) {
- RelationTypeId relationType = RelationTypeId.valueOf(data.getTypeUuid());
- return adjacencies.getRelation(data.getArtifactIdA(), relationType, data.getArtifactIdB());
+ return adjacencies.getRelation(data.getArtifactIdA(), data.getType(), data.getArtifactIdB());
}
private RelationNodeAdjacencies getAdjacencies(GraphData graph, ArtifactId id) {
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/Relation.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/Relation.java
index 0699191ed5..7b0cff5fec 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/Relation.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/Relation.java
@@ -14,26 +14,21 @@ import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.IRelationType;
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.framework.core.enums.RelationSide;
import org.eclipse.osee.orcs.core.ds.HasOrcsData;
import org.eclipse.osee.orcs.core.ds.RelationData;
import org.eclipse.osee.orcs.core.internal.util.OrcsWriteable;
import org.eclipse.osee.orcs.data.RelationReadable;
-import org.eclipse.osee.orcs.data.RelationTypes;
/**
* @author Roberto E. Escobar
*/
-public class Relation implements RelationReadable, HasOrcsData<RelationData>, OrcsWriteable {
-
- private final RelationTypes relationTypes;
-
+public class Relation implements RelationReadable, HasOrcsData<RelationTypeToken, RelationData>, OrcsWriteable {
private RelationData relationData;
- public Relation(RelationTypes relationTypes, RelationData relationData) {
- super();
- this.relationTypes = relationTypes;
+ public Relation(RelationData relationData) {
this.relationData = relationData;
}
@@ -49,7 +44,7 @@ public class Relation implements RelationReadable, HasOrcsData<RelationData>, Or
@Override
public RelationTypeId getRelationType() {
- return relationTypes.get(getOrcsData().getTypeUuid());
+ return getOrcsData().getType();
}
@Override
@@ -185,5 +180,4 @@ public class Relation implements RelationReadable, HasOrcsData<RelationData>, Or
public int getArtIdB() {
return getOrcsData().getArtIdB();
}
-
-}
+} \ No newline at end of file
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 1337ea03e9..3e2da863c0 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
@@ -17,18 +17,14 @@ import org.eclipse.osee.orcs.core.ds.RelationDataFactory;
import org.eclipse.osee.orcs.core.internal.artifact.Artifact;
import org.eclipse.osee.orcs.core.internal.relation.impl.RelationNodeAdjacencies;
import org.eclipse.osee.orcs.core.internal.util.OrcsConditions;
-import org.eclipse.osee.orcs.data.RelationTypes;
/**
* @author Roberto E. Escobar
*/
public class RelationFactory {
-
- private final RelationTypes relationTypes;
private final RelationDataFactory relationDataFactory;
- public RelationFactory(RelationTypes relationTypes, RelationDataFactory relationDataFactory) {
- this.relationTypes = relationTypes;
+ public RelationFactory(RelationDataFactory relationDataFactory) {
this.relationDataFactory = relationDataFactory;
}
@@ -37,7 +33,7 @@ public class RelationFactory {
}
public Relation createRelation(RelationData data) {
- return new Relation(relationTypes, data);
+ return new Relation(data);
}
public Relation createRelation(Artifact aNode, RelationTypeToken type, Artifact bNode) {
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 db684d1acf..38ede97e39 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
@@ -465,8 +465,7 @@ public class RelationManagerImpl implements RelationManager {
destination.getGraph().addAdjacencies(destination, adjacencies2);
for (Relation relation : adjacencies1.getAll()) {
Relation newRel = relationFactory.clone(relation);
- RelationTypeId relationType = RelationTypeId.valueOf(newRel.getOrcsData().getTypeUuid());
- adjacencies2.add(relationType, newRel);
+ adjacencies2.add(newRel.getOrcsData().getType(), newRel);
}
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryTest.java
index c20b2c9472..1321a1d3b5 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryTest.java
@@ -30,6 +30,7 @@ import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.data.RelationId;
import org.eclipse.osee.framework.core.data.RelationTypeId;
import org.eclipse.osee.framework.core.data.TransactionToken;
+import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.DemoBranches;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.executor.HasCancellation;
@@ -362,6 +363,7 @@ public class MissingChangeItemFactoryTest {
data.setModType(modType);
data.setLocalId(attrId);
data.setDataProxy(proxy);
+ data.setBaseType(CoreAttributeTypes.Name);
data.setApplicabilityId(ApplicabilityId.BASE);
return data;
}
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 97e60c0334..ccc229e152 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
@@ -10,23 +10,26 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.loader;
+import static org.eclipse.osee.framework.core.enums.CoreArtifactTypes.Artifact;
+import static org.eclipse.osee.framework.core.enums.CoreArtifactTypes.Design;
+import static org.eclipse.osee.framework.core.enums.CoreArtifactTypes.Folder;
+import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.Active;
+import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.Name;
import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
+import static org.eclipse.osee.framework.core.enums.CoreRelationTypes.DEFAULT_HIERARCHY;
+import static org.eclipse.osee.framework.core.enums.CoreRelationTypes.Design__Design;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotSame;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.AttributeTypeToken;
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.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.CoreAttributeTypes;
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;
@@ -98,7 +101,7 @@ public class DataFactoryImplTest {
guid = GUID.create();
- OrcsObjectFactory objectFactory = new OrcsObjectFactoryImpl(proxyFactory, relationTypes);
+ OrcsObjectFactory objectFactory = new OrcsObjectFactoryImpl(proxyFactory, relationTypes, artifactCache);
dataFactory = new DataFactoryImpl(idFactory, objectFactory, artifactCache);
when(idFactory.getNextArtifactId()).thenReturn(ART_ID.intValue());
@@ -113,24 +116,24 @@ public class DataFactoryImplTest {
artData = new ArtifactDataImpl(verData);
artData.setLocalId(SHARED_ID.intValue());
artData.setModType(ModificationType.MODIFIED);
- artData.setTypeUuid(666L);
+ artData.setType(Artifact);
artData.setBaseModType(ModificationType.NEW);
- artData.setBaseTypeUuid(777L);
+ artData.setBaseType(Folder);
// ATTRIBUTE
when(attrData.getVersion()).thenReturn(verData);
when(attrData.getLocalId()).thenReturn(SHARED_ID.intValue());
when(attrData.getId()).thenReturn(SHARED_ID);
when(attrData.getModType()).thenReturn(ModificationType.MODIFIED);
- when(attrData.getTypeUuid()).thenReturn(666L);
+ when(attrData.getType()).thenReturn(Name);
when(attrData.getBaseModType()).thenReturn(ModificationType.NEW);
- when(attrData.getBaseTypeUuid()).thenReturn(777L);
+ when(attrData.getBaseType()).thenReturn(Active);
when(attrData.getArtifactId()).thenReturn(art88);
when(attrData.getDataProxy()).thenReturn(dataProxy);
when(dataProxy.getRawValue()).thenReturn(expectedProxyValue);
when(dataProxy.getUri()).thenReturn(expectedProxyUri);
- when(proxyFactory.createProxy(666L, expectedProxyValue, expectedProxyUri)).thenReturn(otherDataProxy);
+ when(proxyFactory.createProxy(Name, expectedProxyValue, expectedProxyUri)).thenReturn(otherDataProxy);
when(otherDataProxy.getRawValue()).thenReturn(expectedProxyValue);
when(otherDataProxy.getUri()).thenReturn(expectedProxyUri);
@@ -138,9 +141,9 @@ public class DataFactoryImplTest {
relData = new RelationDataImpl(verData);
relData.setLocalId(SHARED_ID.intValue());
relData.setModType(ModificationType.MODIFIED);
- relData.setTypeUuid(666);
+ relData.setType(Design__Design);
relData.setBaseModType(ModificationType.NEW);
- relData.setBaseTypeUuid(777);
+ relData.setBaseType(DEFAULT_HIERARCHY);
relData.setArtIdA(art88);
relData.setArtIdB(art99);
relData.setRationale("this is the rationale");
@@ -158,8 +161,6 @@ public class DataFactoryImplTest {
@Test
public void testCreateArtifactDataInvalidGuid() {
- when(artifactCache.get(artifactType)).thenReturn(artifactType);
- when(artifactCache.isAbstract(artifactType)).thenReturn(false);
when(idFactory.getUniqueGuid(guid)).thenReturn("123");
thrown.expect(OseeArgumentException.class);
@@ -170,10 +171,10 @@ public class DataFactoryImplTest {
@Test
public void testCreateArtifactData() {
- when(artifactCache.isAbstract(artifactType)).thenReturn(false);
+ when(artifactCache.isAbstract(Design)).thenReturn(false);
when(idFactory.getUniqueGuid(guid)).thenReturn(guid);
- ArtifactData actual = dataFactory.create(COMMON, artifactType, guid);
+ ArtifactData actual = dataFactory.create(COMMON, Design, guid);
verify(idFactory).getUniqueGuid(guid);
verify(idFactory).getNextArtifactId();
@@ -188,19 +189,17 @@ public class DataFactoryImplTest {
assertEquals(ART_ID, actual.getId());
assertEquals(RelationalConstants.DEFAULT_MODIFICATION_TYPE, actual.getModType());
- assertEquals(artifactType, actual.getTypeUuid());
+ assertEquals(Design, actual.getType());
assertEquals(RelationalConstants.DEFAULT_MODIFICATION_TYPE, actual.getBaseModType());
- assertEquals(artifactType, actual.getBaseTypeUuid());
+ assertEquals(Design, actual.getBaseType());
assertEquals(guid, actual.getGuid());
}
@Test
public void testCreateArtifactDataGenerateGuid() {
- when(artifactCache.get(artifactType)).thenReturn(artifactType);
- when(artifactCache.isAbstract(artifactType)).thenReturn(false);
when(idFactory.getUniqueGuid(guid)).thenReturn(guid);
- ArtifactData actual = dataFactory.create(COMMON, artifactType, guid);
+ ArtifactData actual = dataFactory.create(COMMON, Artifact, guid);
verify(idFactory).getUniqueGuid(guid);
verify(idFactory).getNextArtifactId();
@@ -214,23 +213,21 @@ public class DataFactoryImplTest {
assertEquals(ART_ID, actual.getId());
assertEquals(RelationalConstants.DEFAULT_MODIFICATION_TYPE, actual.getModType());
- assertEquals(artifactType, actual.getTypeUuid());
+ assertEquals(Artifact, actual.getType());
assertEquals(RelationalConstants.DEFAULT_MODIFICATION_TYPE, actual.getBaseModType());
- assertEquals(artifactType, actual.getBaseTypeUuid());
+ assertEquals(Artifact, actual.getBaseType());
assertEquals(guid, actual.getGuid());
}
@Test
public void testCreateAttributeData() {
- AttributeTypeToken attributeType = CoreAttributeTypes.Name;
-
- when(proxyFactory.createProxy(2389L, 2389, "")).thenReturn(otherDataProxy);
+ when(proxyFactory.createProxy(Name, "", "")).thenReturn(otherDataProxy);
when(otherDataProxy.getRawValue()).thenReturn(2389);
when(otherDataProxy.getUri()).thenReturn("");
when(idFactory.getNextAttributeId()).thenReturn(1);
- AttributeData actual = dataFactory.create(artData, attributeType);
+ AttributeData actual = dataFactory.create(artData, Name);
VersionData actualVer = actual.getVersion();
assertEquals(BRANCH, actualVer.getBranch());
@@ -240,11 +237,11 @@ public class DataFactoryImplTest {
assertEquals(false, actualVer.isHistorical());
assertEquals(false, actualVer.isInStorage());
- Assert.assertTrue("local id must be valid", actual.getLocalId() > 0);
+ Assert.assertTrue("local id must be valid", actual.isValid());
assertEquals(RelationalConstants.DEFAULT_MODIFICATION_TYPE, actual.getModType());
- assertEquals(attributeType.getId().longValue(), actual.getTypeUuid());
+ assertEquals(Name, actual.getType());
assertEquals(RelationalConstants.DEFAULT_MODIFICATION_TYPE, actual.getBaseModType());
- assertEquals(attributeType.getId().longValue(), actual.getBaseTypeUuid());
+ assertEquals(Name, actual.getBaseType());
assertEquals(artifactId555, actual.getArtifactId());
assertNotSame(dataProxy, actual.getDataProxy());
@@ -252,13 +249,11 @@ public class DataFactoryImplTest {
@Test
public void testCreateRelationData() {
- RelationTypeToken relationType = CoreRelationTypes.Default_Hierarchical__Child;
-
ArtifactId aArt = ArtifactId.valueOf(4562);
ArtifactId bArt = ArtifactId.valueOf(9513);
when(idFactory.getNextRelationId()).thenReturn(1);
- RelationData actual = dataFactory.createRelationData(relationType, COMMON, aArt, bArt, "My rationale");
+ RelationData actual = dataFactory.createRelationData(Design__Design, COMMON, aArt, bArt, "My rationale");
VersionData actualVer = actual.getVersion();
assertEquals(COMMON, actualVer.getBranch());
@@ -270,9 +265,9 @@ public class DataFactoryImplTest {
Assert.assertTrue("local id must be valid", actual.getLocalId() > 0);
assertEquals(RelationalConstants.DEFAULT_MODIFICATION_TYPE, actual.getModType());
- assertEquals(relationType.getId().longValue(), actual.getTypeUuid());
+ assertEquals(Design__Design, actual.getType());
assertEquals(RelationalConstants.DEFAULT_MODIFICATION_TYPE, actual.getBaseModType());
- assertEquals(relationType.getId().longValue(), actual.getBaseTypeUuid());
+ assertEquals(Design__Design, actual.getBaseType());
assertEquals(aArt, actual.getArtifactIdA());
assertEquals(bArt, actual.getArtifactIdB());
@@ -294,9 +289,9 @@ public class DataFactoryImplTest {
assertEquals(artifactId555, actual);
assertEquals(artData.getModType(), actual.getModType());
- assertEquals(666L, actual.getTypeUuid());
+ assertEquals(Artifact, actual.getType());
assertEquals(ModificationType.NEW, actual.getBaseModType());
- assertEquals(777L, actual.getBaseTypeUuid());
+ assertEquals(Folder, actual.getBaseType());
}
@Test
@@ -314,9 +309,9 @@ public class DataFactoryImplTest {
assertEquals(SHARED_ID, actual.getId());
assertEquals(attrData.getModType(), actual.getModType());
- assertEquals(666L, actual.getTypeUuid());
+ assertEquals(Name, actual.getType());
assertEquals(ModificationType.NEW, actual.getBaseModType());
- assertEquals(777L, actual.getBaseTypeUuid());
+ assertEquals(Active, actual.getBaseType());
assertEquals(art88, actual.getArtifactId());
assertNotSame(dataProxy, actual.getDataProxy());
@@ -345,9 +340,9 @@ public class DataFactoryImplTest {
assertEquals(ART_ID, actual.getId());
assertEquals(ModificationType.NEW, actual.getModType());
- assertEquals(666L, actual.getTypeUuid());
+ assertEquals(actual.getType(), Artifact);
assertEquals(ModificationType.NEW, actual.getBaseModType());
- assertEquals(777L, actual.getBaseTypeUuid());
+ assertEquals(Folder, actual.getBaseType());
assertEquals(newGuid, actual.getGuid());
}
@@ -366,9 +361,9 @@ public class DataFactoryImplTest {
assertEquals(RelationalConstants.DEFAULT_ITEM_ID, actual.getLocalId());
assertEquals(ModificationType.NEW, actual.getModType());
- assertEquals(666L, actual.getTypeUuid());
+ assertEquals(Name, actual.getType());
assertEquals(ModificationType.NEW, actual.getBaseModType());
- assertEquals(777L, actual.getBaseTypeUuid());
+ assertEquals(Active, actual.getBaseType());
assertEquals(art88, actual.getArtifactId());
assertNotSame(dataProxy, actual.getDataProxy());
@@ -394,15 +389,15 @@ public class DataFactoryImplTest {
assertEquals(artifactId555, actual);
assertEquals(ModificationType.MODIFIED, actual.getModType());
- assertEquals(666L, actual.getTypeUuid());
+ assertEquals(Artifact, actual.getType());
assertEquals(ModificationType.NEW, actual.getBaseModType());
- assertEquals(777L, actual.getBaseTypeUuid());
+ assertEquals(Folder, actual.getBaseType());
}
@Test
public void testCloneAttributeData() {
AttributeData actual = dataFactory.clone(attrData);
- verify(proxyFactory).createProxy(666L, expectedProxyValue, expectedProxyUri);
+ verify(proxyFactory).createProxy(Name, expectedProxyValue, expectedProxyUri);
VersionData actualVer = actual.getVersion();
@@ -418,9 +413,9 @@ public class DataFactoryImplTest {
assertEquals(SHARED_ID, actual.getId());
assertEquals(ModificationType.MODIFIED, actual.getModType());
- assertEquals(666L, actual.getTypeUuid());
+ assertEquals(Name, actual.getType());
assertEquals(ModificationType.NEW, actual.getBaseModType());
- assertEquals(777L, actual.getBaseTypeUuid());
+ assertEquals(Active, actual.getBaseType());
assertEquals(art88, actual.getArtifactId());
assertNotSame(dataProxy, actual.getDataProxy());
@@ -446,13 +441,12 @@ public class DataFactoryImplTest {
assertEquals(SHARED_ID, actual.getId());
assertEquals(ModificationType.MODIFIED, actual.getModType());
- assertEquals(666L, actual.getTypeUuid());
+ assertEquals(Design__Design, actual.getType());
assertEquals(ModificationType.NEW, actual.getBaseModType());
- assertEquals(777L, actual.getBaseTypeUuid());
+ assertEquals(DEFAULT_HIERARCHY, actual.getBaseType());
assertEquals(art88, actual.getArtifactIdA());
assertEquals(art99, actual.getArtifactIdB());
assertEquals("this is the rationale", actual.getRationale());
}
-
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java
index 9cda0dceab..846d4597ad 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java
@@ -30,13 +30,20 @@ import java.util.Date;
import java.util.List;
import java.util.Map.Entry;
import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.framework.core.data.GammaId;
+import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.OseeCodeVersion;
+import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.data.UserId;
+import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
+import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
import org.eclipse.osee.framework.core.enums.TxChange;
+import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.orcs.core.ds.ArtifactData;
import org.eclipse.osee.orcs.core.ds.ArtifactDataImpl;
@@ -83,7 +90,9 @@ public class TxSqlBuilderTest {
private static final int ITEM_ID = 789;
private static final String EXP_GUID = GUID.create();
- private static final long TYPE_UUID = 72132144189L;
+ private static final IArtifactType artfactType = CoreArtifactTypes.Artifact;
+ private static final RelationTypeToken relationType = CoreRelationTypes.DEFAULT_HIERARCHY;
+ private static final AttributeTypeToken attributeType = CoreAttributeTypes.Name;
private static final GammaId NEXT_GAMMA_ID = GammaId.valueOf(751382);
@@ -123,18 +132,18 @@ public class TxSqlBuilderTest {
artData = new ArtifactDataImpl(versionData);
artData.setLocalId(ITEM_ID);
- artData.setTypeUuid(TYPE_UUID);
+ artData.setType(artfactType);
artData.setGuid(EXP_GUID);
attrData = new AttributeDataImpl(versionData);
attrData.setLocalId(ITEM_ID);
- attrData.setTypeUuid(TYPE_UUID);
+ attrData.setType(attributeType);
attrData.setArtifactId(ATTR_ARTIFACT_ID);
attrData.setDataProxy(dataProxy);
relData = new RelationDataImpl(versionData);
relData.setLocalId(ITEM_ID);
- relData.setTypeUuid(TYPE_UUID);
+ relData.setType(relationType);
relData.setArtIdA(A_ART_ID);
relData.setArtIdB(B_ART_ID);
relData.setRationale(RATIONALE);
@@ -191,7 +200,7 @@ public class TxSqlBuilderTest {
verifyEmpty(allExcept(SqlOrderEnum.TXS_DETAIL, SqlOrderEnum.TXS, SqlOrderEnum.ARTIFACTS));
// @formatter:off
- verifyRow(SqlOrderEnum.ARTIFACTS, ITEM_ID, TYPE_UUID, NEXT_GAMMA_ID, EXP_GUID);
+ verifyRow(SqlOrderEnum.ARTIFACTS, ITEM_ID, artfactType, NEXT_GAMMA_ID, EXP_GUID);
verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, NEXT_GAMMA_ID, modType, TxChange.CURRENT, COMMON);
verifyQuery(SqlOrderEnum.ARTIFACTS);
// @formatter:on
@@ -239,8 +248,8 @@ public class TxSqlBuilderTest {
// test existing artifact with no changes
artData.setBaseModType(ModificationType.DELETED);
- artData.setBaseTypeUuid(0);
- artData.setTypeUuid(0);
+ artData.setBaseType(artfactType);
+ artData.setType(artfactType);
builder.visit(artData);
assertTrue(builder.getBinaryStores().isEmpty());
@@ -261,7 +270,7 @@ public class TxSqlBuilderTest {
verifyEmpty(allExcept(SqlOrderEnum.TXS_DETAIL, SqlOrderEnum.TXS, SqlOrderEnum.RELATIONS));
// @formatter:off
- verifyRow(SqlOrderEnum.RELATIONS, ITEM_ID, TYPE_UUID, NEXT_GAMMA_ID, A_ART_ID.getId().intValue(), B_ART_ID.getId().intValue(), RATIONALE);
+ verifyRow(SqlOrderEnum.RELATIONS, ITEM_ID, relationType, NEXT_GAMMA_ID, A_ART_ID.getId().intValue(), B_ART_ID.getId().intValue(), RATIONALE);
verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, NEXT_GAMMA_ID, modType, TxChange.CURRENT, COMMON);
verifyQuery(SqlOrderEnum.RELATIONS);
// @formatter:on
@@ -306,7 +315,7 @@ public class TxSqlBuilderTest {
verifyEmpty(allExcept(SqlOrderEnum.TXS_DETAIL, SqlOrderEnum.TXS, SqlOrderEnum.ATTRIBUTES));
// @formatter:off
- verifyRow(SqlOrderEnum.ATTRIBUTES, ITEM_ID, TYPE_UUID, NEXT_GAMMA_ID, ATTR_ARTIFACT_ID, ATTR_VALUE, ATTR_URI);
+ verifyRow(SqlOrderEnum.ATTRIBUTES, ITEM_ID, attributeType, NEXT_GAMMA_ID, ATTR_ARTIFACT_ID, ATTR_VALUE, ATTR_URI);
verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, NEXT_GAMMA_ID, modType, TxChange.CURRENT, COMMON);
verifyQuery(SqlOrderEnum.ATTRIBUTES);
// @formatter:on
@@ -319,7 +328,7 @@ public class TxSqlBuilderTest {
when(dataProxy.getUri()).thenReturn("aURI");
builder.updateAfterBinaryStorePersist();
- verifyRow(SqlOrderEnum.ATTRIBUTES, ITEM_ID, TYPE_UUID, NEXT_GAMMA_ID, ATTR_ARTIFACT_ID, "aValue", "aURI");
+ verifyRow(SqlOrderEnum.ATTRIBUTES, ITEM_ID, attributeType, NEXT_GAMMA_ID, ATTR_ARTIFACT_ID, "aValue", "aURI");
reset(attrData);
}
@@ -347,7 +356,7 @@ public class TxSqlBuilderTest {
}
}
- private void reset(OrcsData data) {
+ private <T extends Id> void reset(OrcsData<T> data) {
data.getVersion().setTransactionId(LOADED_TX_ID);
data.getVersion().setGammaId(GammaId.SENTINEL);
}
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 b8a320804b..82f2cd0725 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
@@ -28,6 +28,7 @@ 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;
import org.eclipse.osee.orcs.db.internal.loader.SqlObjectLoader;
+import org.eclipse.osee.orcs.db.internal.loader.data.OrcsObjectFactoryImpl;
import org.eclipse.osee.orcs.db.internal.loader.processor.DynamicLoadProcessor;
import org.eclipse.osee.orcs.db.internal.proxy.AttributeDataProxyFactory;
import org.eclipse.osee.orcs.db.internal.search.QueryModule;
@@ -66,7 +67,7 @@ public class DataModuleFactory {
final QueryEngineIndexer indexer = queryModule.getQueryIndexer();
final AttributeDataProxyFactory proxyFactory = loaderModule.createProxyDataFactory(attributeTypes);
- final OrcsObjectFactory objectFactory = loaderModule.createOrcsObjectFactory(proxyFactory, relationTypes);
+ final OrcsObjectFactory objectFactory = new OrcsObjectFactoryImpl(proxyFactory, relationTypes, artifactTypes);
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/change/MissingChangeItemFactoryImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryImpl.java
index f2620a3c2b..d31f1b209a 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryImpl.java
@@ -22,10 +22,7 @@ import java.util.Set;
import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.ApplicabilityToken;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.ArtifactTypeId;
-import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.RelationId;
-import org.eclipse.osee.framework.core.data.RelationTypeId;
import org.eclipse.osee.framework.core.data.TransactionToken;
import org.eclipse.osee.framework.core.enums.LoadLevel;
import org.eclipse.osee.framework.core.enums.ModificationType;
@@ -210,7 +207,7 @@ public class MissingChangeItemFactoryImpl implements MissingChangeItemFactory {
return toReturn;
}
- private ModificationType determineModType(OrcsData data) {
+ private <T extends Id> ModificationType determineModType(OrcsData<T> data) {
if (data.getModType().matches(ModificationType.DELETED, ModificationType.ARTIFACT_DELETED)) {
return data.getModType();
} else {
@@ -220,25 +217,24 @@ public class MissingChangeItemFactoryImpl implements MissingChangeItemFactory {
private ChangeItem createArtifactChangeItem(ArtifactData data) {
ApplicabilityId appId = data.getApplicabilityId();
- ChangeItem artChange = ChangeItemUtil.newArtifactChange(ArtifactId.valueOf(data.getLocalId()),
- ArtifactTypeId.valueOf(data.getTypeUuid()), data.getVersion().getGammaId(), determineModType(data),
- getApplicabilityToken(appId));
+ ChangeItem artChange = ChangeItemUtil.newArtifactChange(ArtifactId.valueOf(data.getLocalId()), data.getType(),
+ data.getVersion().getGammaId(), determineModType(data), getApplicabilityToken(appId));
return artChange;
}
- private ChangeItem createAttributeChangeItem(AttributeData<?> data) {
+ private <T> ChangeItem createAttributeChangeItem(AttributeData<T> data) {
ApplicabilityId appId = data.getApplicabilityId();
- ChangeItem attrChange = ChangeItemUtil.newAttributeChange(data, AttributeTypeId.valueOf(data.getTypeUuid()),
- data.getArtifactId(), data.getVersion().getGammaId(), determineModType(data),
- data.getDataProxy().getDisplayableString(), getApplicabilityToken(appId));
+ ChangeItem attrChange =
+ ChangeItemUtil.newAttributeChange(data, data.getType(), data.getArtifactId(), data.getVersion().getGammaId(),
+ determineModType(data), data.getDataProxy().getDisplayableString(), getApplicabilityToken(appId));
attrChange.getNetChange().copy(attrChange.getCurrentVersion());
return attrChange;
}
private ChangeItem createRelationChangeItem(RelationData data) {
ApplicabilityId appId = data.getApplicabilityId();
- return ChangeItemUtil.newRelationChange(RelationId.valueOf(Long.valueOf(data.getLocalId())),
- RelationTypeId.valueOf(data.getTypeUuid()), data.getVersion().getGammaId(), determineModType(data),
- data.getArtifactIdA(), data.getArtifactIdB(), data.getRationale(), getApplicabilityToken(appId));
+ return ChangeItemUtil.newRelationChange(RelationId.valueOf(data.getLocalId().longValue()), data.getType(),
+ data.getVersion().getGammaId(), determineModType(data), data.getArtifactIdA(), data.getArtifactIdB(),
+ data.getRationale(), getApplicabilityToken(appId));
}
} \ No newline at end of file
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 fa170b813d..c0a523c625 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
@@ -23,6 +23,7 @@ import org.eclipse.osee.framework.core.data.Tuple2Type;
import org.eclipse.osee.framework.core.data.Tuple3Type;
import org.eclipse.osee.framework.core.data.Tuple4Type;
import org.eclipse.osee.framework.core.enums.ModificationType;
+import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.orcs.core.ds.ArtifactData;
@@ -46,7 +47,6 @@ public class DataFactoryImpl implements DataFactory {
private final ArtifactTypes artifactCache;
public DataFactoryImpl(IdentityManager idFactory, OrcsObjectFactory objectFactory, ArtifactTypes artifactTypes) {
- super();
this.idFactory = idFactory;
this.objectFactory = objectFactory;
this.artifactCache = artifactTypes;
@@ -178,7 +178,7 @@ public class DataFactoryImpl implements DataFactory {
return objectFactory.createCopy(source);
}
- private void updateDataForCopy(BranchId destination, OrcsData data) {
+ private <T extends Id> void updateDataForCopy(BranchId destination, OrcsData<T> data) {
VersionData version = data.getVersion();
version.setBranch(destination);
version.setTransactionId(TransactionId.SENTINEL);
@@ -189,7 +189,7 @@ public class DataFactoryImpl implements DataFactory {
data.setModType(ModificationType.NEW);
}
- private void updateDataForIntroduce(BranchId destination, OrcsData data) {
+ private <T extends Id> void updateDataForIntroduce(BranchId destination, OrcsData<T> data) {
VersionData version = data.getVersion();
version.setBranch(destination);
version.setHistorical(false);
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 9f64e54aeb..0d19de2c1f 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,10 +18,8 @@ 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;
import org.eclipse.osee.orcs.db.internal.loader.handlers.LoaderSqlHandlerFactoryUtil;
import org.eclipse.osee.orcs.db.internal.loader.processor.DynamicLoadProcessor;
import org.eclipse.osee.orcs.db.internal.proxy.AttributeDataProxyFactory;
@@ -50,10 +48,6 @@ public class LoaderModule {
return new AttributeDataProxyFactory(attributeTypes, resourceManager, logger);
}
- public OrcsObjectFactory createOrcsObjectFactory(AttributeDataProxyFactory proxyFactory, RelationTypes relationTypes) {
- return new OrcsObjectFactoryImpl(proxyFactory, relationTypes);
- }
-
public DataFactory createDataFactory(OrcsObjectFactory factory, ArtifactTypes artifactTypes) {
return new DataFactoryImpl(idFactory, factory, artifactTypes);
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/ArtifactObjectFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/ArtifactObjectFactory.java
index 466c3a12b6..8126e5aa22 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/ArtifactObjectFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/ArtifactObjectFactory.java
@@ -21,9 +21,9 @@ import org.eclipse.osee.orcs.core.ds.VersionData;
*/
public interface ArtifactObjectFactory extends VersionObjectFactory {
- ArtifactData createArtifactData(VersionData version, Integer id, long typeID, ModificationType modType, String guid, ApplicabilityId applicId);
+ ArtifactData createArtifactData(VersionData version, Integer generateArtId, long artifactType, ModificationType modType, String guidToSet, ApplicabilityId applicId);
- ArtifactData createArtifactData(VersionData version, int generateArtId, IArtifactType type, ModificationType modType, String guidToSet, ApplicabilityId applicId);
+ ArtifactData createArtifactData(VersionData version, Integer generateArtId, IArtifactType artifactType, ModificationType modType, String guidToSet, ApplicabilityId applicId);
ArtifactData createCopy(ArtifactData source);
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeDataImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeDataImpl.java
index c86f9e12d0..a7e92a860a 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeDataImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeDataImpl.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.orcs.db.internal.loader.data;
import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.orcs.core.ds.AttributeData;
import org.eclipse.osee.orcs.core.ds.DataProxy;
import org.eclipse.osee.orcs.core.ds.OrcsVersionedObjectImpl;
@@ -19,7 +20,7 @@ import org.eclipse.osee.orcs.core.ds.VersionData;
/**
* @author Roberto E. Escobar
*/
-public class AttributeDataImpl<T> extends OrcsVersionedObjectImpl implements AttributeData<T> {
+public class AttributeDataImpl<T> extends OrcsVersionedObjectImpl<AttributeTypeToken> implements AttributeData<T> {
private ArtifactId artifactId = ArtifactId.SENTINEL;
private boolean useBackingData = false;
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 472854f87b..b63f8d7696 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
@@ -35,6 +35,7 @@ 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.core.ds.VersionDataImpl;
+import org.eclipse.osee.orcs.data.ArtifactTypes;
import org.eclipse.osee.orcs.data.RelationTypes;
import org.eclipse.osee.orcs.db.internal.OrcsObjectFactory;
import org.eclipse.osee.orcs.db.internal.proxy.AttributeDataProxyFactory;
@@ -45,10 +46,12 @@ import org.eclipse.osee.orcs.db.internal.proxy.AttributeDataProxyFactory;
public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
private final AttributeDataProxyFactory proxyFactory;
private final RelationTypes relationTypes;
+ private final ArtifactTypes artifactTypes;
- public OrcsObjectFactoryImpl(AttributeDataProxyFactory proxyFactory, RelationTypes relationTypes) {
+ public OrcsObjectFactoryImpl(AttributeDataProxyFactory proxyFactory, RelationTypes relationTypes, ArtifactTypes artifactTypes) {
this.proxyFactory = proxyFactory;
this.relationTypes = relationTypes;
+ this.artifactTypes = artifactTypes;
}
@Override
@@ -91,51 +94,46 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
}
@Override
- public ArtifactData createArtifactData(VersionData version, Integer id, long typeUuid, ModificationType modType, String guid, ApplicabilityId applicId) {
- return createArtifactFromRow(version, id, typeUuid, modType, typeUuid, modType, guid, applicId);
- }
-
- @Override
- public ArtifactData createArtifactData(VersionData version, int id, IArtifactType type, ModificationType modType, String guid, ApplicabilityId applicId) {
- return createArtifactFromRow(version, id, type.getId(), modType, type.getId(), modType, guid, applicId);
+ public ArtifactData createArtifactData(VersionData version, Integer generateArtId, IArtifactType artifactType, ModificationType modType, String guidToSet, ApplicabilityId applicId) {
+ return createArtifactFromRow(version, generateArtId, artifactType, modType, artifactType, modType, guidToSet,
+ applicId);
}
@Override
public ArtifactData createCopy(ArtifactData source) {
VersionData newVersion = createCopy(source.getVersion());
- return createArtifactFromRow(newVersion, source.getLocalId(), source.getTypeUuid(), source.getModType(),
- source.getBaseTypeUuid(), source.getBaseModType(), source.getGuid(), source.getApplicabilityId());
+ return createArtifactFromRow(newVersion, source.getLocalId(), source.getType(), source.getModType(),
+ source.getBaseType(), source.getBaseModType(), source.getGuid(), source.getApplicabilityId());
}
@Override
public <T> AttributeData<T> createAttributeData(VersionData version, Integer id, AttributeTypeToken attributeType, ModificationType modType, ArtifactId artifactId, T value, String uri, ApplicabilityId applicId) {
- Long typeId = attributeType.getId();
- DataProxy<T> proxy = proxyFactory.createProxy(typeId, value, uri);
- return createAttributeFromRow(version, id, typeId, modType, typeId, modType, artifactId, proxy, applicId);
+ DataProxy<T> proxy = proxyFactory.createProxy(attributeType, value, uri);
+ return createAttributeFromRow(version, id, attributeType, modType, attributeType, modType, artifactId, proxy,
+ applicId);
}
@Override
public <T> AttributeData<T> createCopy(AttributeData<T> source) {
VersionData newVersion = createCopy(source.getVersion());
- long typeId = source.getTypeUuid();
+ AttributeTypeToken attributeType = source.getType();
DataProxy<T> sourceProxy = source.getDataProxy();
- DataProxy<T> newProxy = proxyFactory.createProxy(typeId, sourceProxy.getRawValue(), sourceProxy.getUri());
- return createAttributeFromRow(newVersion, source.getLocalId(), typeId, source.getModType(),
- source.getBaseTypeUuid(), source.getBaseModType(), source.getArtifactId(), newProxy,
- source.getApplicabilityId());
+ DataProxy<T> newProxy = proxyFactory.createProxy(attributeType, sourceProxy.getRawValue(), sourceProxy.getUri());
+ return createAttributeFromRow(newVersion, source.getId().intValue(), attributeType, source.getModType(),
+ source.getBaseType(), source.getBaseModType(), source.getArtifactId(), newProxy, source.getApplicabilityId());
}
@Override
- public <T> AttributeData<T> createAttributeData(VersionData version, Integer id, AttributeTypeToken attributeType, ModificationType modType, ArtifactId artId, ApplicabilityId applicId) {
- long typeId = attributeType.getId();
- DataProxy<T> proxy = proxyFactory.createProxy(typeId, "", "");
- return createAttributeFromRow(version, id, typeId, modType, typeId, modType, artId, proxy, applicId);
+ public <T> AttributeData<T> createAttributeData(VersionData version, Integer generateArtId, AttributeTypeToken attributeType, ModificationType modType, ArtifactId artId, ApplicabilityId applicId) {
+ DataProxy<T> proxy = proxyFactory.createProxy(attributeType, "", "");
+ return createAttributeFromRow(version, generateArtId, attributeType, modType, attributeType, modType, artId,
+ proxy, applicId);
}
@Override
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);
+ return createRelationData(version, id, relationType, modType, relationType, modType, aArtId, bArtId, rationale,
+ applicId);
}
@Override
@@ -144,11 +142,11 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
applicId);
}
- private ArtifactData createArtifactFromRow(VersionData version, int id, long localTypeID, ModificationType modType, long baseLocalTypeID, ModificationType baseModType, String guid, ApplicabilityId applicId) {
+ private ArtifactData createArtifactFromRow(VersionData version, int generateArtId, IArtifactType artifactType, ModificationType modType, IArtifactType baseArtifactType, ModificationType baseModType, String guid, ApplicabilityId applicId) {
ArtifactData data = new ArtifactDataImpl(version);
- data.setLocalId(id);
- data.setTypeUuid(localTypeID);
- data.setBaseTypeUuid(baseLocalTypeID);
+ data.setLocalId(generateArtId);
+ data.setType(artifactType);
+ data.setBaseType(baseArtifactType);
data.setModType(modType);
data.setBaseModType(baseModType);
data.setGuid(guid);
@@ -156,11 +154,11 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
return data;
}
- private <T> AttributeData<T> createAttributeFromRow(VersionData version, int id, long localTypeID, ModificationType modType, long baseLocalTypeID, ModificationType baseModType, ArtifactId artifactId, DataProxy<T> proxy, ApplicabilityId applicId) {
+ private <T> AttributeData<T> createAttributeFromRow(VersionData version, int id, AttributeTypeToken attributeType, ModificationType modType, AttributeTypeToken baseAttributeType, ModificationType baseModType, ArtifactId artifactId, DataProxy<T> proxy, ApplicabilityId applicId) {
AttributeData<T> data = new AttributeDataImpl<>(version);
data.setLocalId(id);
- data.setTypeUuid(localTypeID);
- data.setBaseTypeUuid(baseLocalTypeID);
+ data.setType(attributeType);
+ data.setBaseType(baseAttributeType);
data.setModType(modType);
data.setBaseModType(baseModType);
data.setArtifactId(artifactId);
@@ -169,11 +167,11 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
return data;
}
- private RelationData createRelationData(VersionData version, int id, long relationType, ModificationType modType, long baseLocalTypeID, ModificationType baseModType, ArtifactId aArtId, ArtifactId bArtId, String rationale, ApplicabilityId applicId) {
+ private RelationData createRelationData(VersionData version, Integer id, RelationTypeToken relationType, ModificationType modType, RelationTypeToken baseRelationType, ModificationType baseModType, ArtifactId aArtId, ArtifactId bArtId, String rationale, ApplicabilityId applicId) {
RelationData data = new RelationDataImpl(version);
data.setLocalId(id);
- data.setTypeUuid(relationType);
- data.setBaseTypeUuid(baseLocalTypeID);
+ data.setType(relationType);
+ data.setBaseType(baseRelationType);
data.setModType(modType);
data.setBaseModType(baseModType);
data.setArtIdA(aArtId);
@@ -189,8 +187,8 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
@Override
public RelationData createCopy(RelationData source) {
VersionData newVersion = createCopy(source.getVersion());
- return createRelationData(newVersion, source.getLocalId(), source.getTypeUuid(), source.getModType(),
- source.getBaseTypeUuid(), source.getBaseModType(), source.getArtifactIdA(), source.getArtifactIdB(),
+ return createRelationData(newVersion, source.getLocalId(), source.getType(), source.getModType(),
+ source.getBaseType(), source.getBaseModType(), source.getArtifactIdA(), source.getArtifactIdB(),
source.getRationale(), source.getApplicabilityId());
}
@@ -226,4 +224,9 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
data.setElement4(e4);
return data;
}
+
+ @Override
+ public ArtifactData createArtifactData(VersionData version, Integer generateArtId, long artifactType, ModificationType modType, String guidToSet, ApplicabilityId applicId) {
+ return createArtifactData(version, generateArtId, artifactTypes.get(artifactType), modType, guidToSet, applicId);
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationDataImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationDataImpl.java
index 69315d8042..fbb9b99ffb 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationDataImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationDataImpl.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.orcs.db.internal.loader.data;
import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.core.data.RelationalConstants;
import org.eclipse.osee.framework.core.enums.RelationSide;
import org.eclipse.osee.orcs.core.ds.OrcsVersionedObjectImpl;
@@ -20,7 +21,7 @@ import org.eclipse.osee.orcs.core.ds.VersionData;
/**
* @author Andrew M. Finkbeiner
*/
-public class RelationDataImpl extends OrcsVersionedObjectImpl implements RelationData {
+public class RelationDataImpl extends OrcsVersionedObjectImpl<RelationTypeToken> implements RelationData {
private ArtifactId artIdA = ArtifactId.SENTINEL;
private ArtifactId artIdB = ArtifactId.SENTINEL;
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/TupleDataImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/TupleDataImpl.java
index ecddcac196..3eacf8524d 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/TupleDataImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/TupleDataImpl.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.orcs.db.internal.loader.data;
import org.eclipse.osee.framework.core.data.TupleTypeId;
import org.eclipse.osee.orcs.core.ds.OrcsVersionedObjectImpl;
+import org.eclipse.osee.framework.core.data.TupleTypeToken;
import org.eclipse.osee.orcs.core.ds.TupleData;
import org.eclipse.osee.orcs.core.ds.VersionData;
import org.eclipse.osee.orcs.core.internal.tuple.TupleVisitor;
@@ -19,7 +20,7 @@ import org.eclipse.osee.orcs.core.internal.tuple.TupleVisitor;
/**
* @author Angel Avila
*/
-public class TupleDataImpl extends OrcsVersionedObjectImpl implements TupleData {
+public class TupleDataImpl extends OrcsVersionedObjectImpl<TupleTypeToken> implements TupleData {
private TupleTypeId tupleType;
private Long element1;
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/DynamicLoadProcessor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/DynamicLoadProcessor.java
index 38ecfd5c4d..208b748241 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/DynamicLoadProcessor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/DynamicLoadProcessor.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.orcs.db.internal.loader.processor;
import static org.eclipse.osee.orcs.db.internal.sql.SqlFieldResolver.getObjectField;
import java.sql.Timestamp;
import java.util.Collection;
+import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.framework.core.enums.BranchArchivedState;
import org.eclipse.osee.framework.core.enums.BranchState;
import org.eclipse.osee.framework.core.enums.BranchType;
@@ -145,12 +146,10 @@ public class DynamicLoadProcessor extends AbstractLoadProcessor<DynamicDataHandl
private void processCompositeField(JdbcStatement chStmt, DynamicObjectBuilder builder, DynamicData data) {
Collection<String> columnIds = SqlFieldResolver.getColumnUniqueIds(data);
- Object value = getProxyData(chStmt, columnIds);
-
- builder.onDynamicField(data, data.getName(), value);
+ builder.onDynamicField(data, data.getName(), getProxyData(chStmt, columnIds));
}
- private DataProxy getProxyData(JdbcStatement chStmt, Collection<String> columnIds) {
+ private <T> DataProxy<T> getProxyData(JdbcStatement chStmt, Collection<String> columnIds) {
String typeColumnName = null;
String uriColumnName = null;
String valueColumnName = null;
@@ -163,10 +162,10 @@ public class DynamicLoadProcessor extends AbstractLoadProcessor<DynamicDataHandl
valueColumnName = id;
}
}
- long typeUuid = chStmt.getLong(typeColumnName);
+ AttributeTypeToken attributeType = orcsTypes.getAttributeTypes().get(chStmt.getLong(typeColumnName));
String value = chStmt.getString(valueColumnName);
String uri = chStmt.getString(uriColumnName);
- return proxyFactory.createProxy(typeUuid, value, uri);
+ return proxyFactory.createProxy(attributeType, value, uri);
}
private BranchType getBranchType(JdbcStatement chStmt, String columnName) {
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/proxy/AttributeDataProxyFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/proxy/AttributeDataProxyFactory.java
index c656220593..1b5537029a 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/proxy/AttributeDataProxyFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/proxy/AttributeDataProxyFactory.java
@@ -11,7 +11,6 @@
package org.eclipse.osee.orcs.db.internal.proxy;
import org.eclipse.osee.framework.core.data.AttributeTypeId;
-import org.eclipse.osee.framework.jdk.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.resource.management.IResourceManager;
import org.eclipse.osee.logger.Log;
@@ -32,11 +31,7 @@ public class AttributeDataProxyFactory {
this.logger = logger;
}
- public DataProxy createProxy(long typeUuid, Object value, String uri) {
- AttributeTypeId attributeType = attributeTypeCache.get(typeUuid);
-
- Conditions.checkNotNull(attributeType, "AttributeType", "Unable to find attributeType for [%s]", typeUuid);
-
+ public DataProxy createProxy(AttributeTypeId attributeType, Object value, String uri) {
String attributeProviderId = attributeTypeCache.getAttributeProviderId(attributeType);
Object checkedValue = intern(attributeType, value);
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/util/AttributeDataMatcher.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/util/AttributeDataMatcher.java
index 8f90aa294b..f23395b8e9 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/util/AttributeDataMatcher.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/util/AttributeDataMatcher.java
@@ -135,7 +135,7 @@ public class AttributeDataMatcher {
@Override
public long getTypeUuid() {
- return attrData.getTypeUuid();
+ return attrData.getType().getId();
}
@Override
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionIndexer.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionIndexer.java
index 5b22595671..7417bf179e 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionIndexer.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionIndexer.java
@@ -14,7 +14,6 @@ import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.Future;
-import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.executor.HasCancellation;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
@@ -47,8 +46,7 @@ public class TransactionIndexer implements TransactionProcessor {
txData.getChangeSet().accept(new OrcsVisitorAdapter() {
@Override
public <T> void visit(AttributeData<T> data) {
- AttributeTypeId type = types.get(data.getTypeUuid());
- if (types.isTaggable(type)) {
+ if (types.isTaggable(data.getType())) {
datas.add(data.getVersion().getGammaId().getId());
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderImpl.java
index 914e483508..9e87c684f7 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderImpl.java
@@ -109,7 +109,7 @@ public class TxSqlBuilderImpl implements OrcsVisitor, TxSqlBuilder {
updateTxValues(data);
if (!isApplicOnly && !reuseGamma) {
updateGamma(data);
- addRow(SqlOrderEnum.ARTIFACTS, data.getLocalId(), data.getTypeUuid(), data.getVersion().getGammaId(),
+ addRow(SqlOrderEnum.ARTIFACTS, data.getLocalId(), data.getType(), data.getVersion().getGammaId(),
data.getGuid());
}
addTxs(SqlOrderEnum.ARTIFACTS, data);
@@ -133,7 +133,7 @@ public class TxSqlBuilderImpl implements OrcsVisitor, TxSqlBuilder {
int id = idManager.getNextAttributeId();
data.setLocalId(id);
}
- addRow(SqlOrderEnum.ATTRIBUTES, data.getLocalId(), data.getTypeUuid(), data.getVersion().getGammaId(),
+ addRow(SqlOrderEnum.ATTRIBUTES, data.getLocalId(), data.getType(), data.getVersion().getGammaId(),
data.getArtifactId(), dataProxy.getStorageString(), dataProxy.getUri());
}
addTxs(SqlOrderEnum.ATTRIBUTES, data);
@@ -183,7 +183,7 @@ public class TxSqlBuilderImpl implements OrcsVisitor, TxSqlBuilder {
int id = idManager.getNextRelationId();
data.setLocalId(id);
}
- addRow(SqlOrderEnum.RELATIONS, data.getLocalId(), data.getTypeUuid(), data.getVersion().getGammaId(),
+ addRow(SqlOrderEnum.RELATIONS, data.getLocalId(), data.getType(), data.getVersion().getGammaId(),
data.getArtIdA(), data.getArtIdB(), data.getRationale());
}
addTxs(SqlOrderEnum.RELATIONS, data);

Back to the top