Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2018-09-03 18:59:13 -0400
committerRyan D. Brooks2018-09-05 12:26:26 -0400
commit22e105c25fe865767d13e8db67931b1f300b081c (patch)
tree3dad34b0d7cda20c349a04ff0dc6145a4ab96289
parent533930983116a3c94f34e58d3d20f3876916ae62 (diff)
downloadorg.eclipse.osee-22e105c25fe865767d13e8db67931b1f300b081c.tar.gz
org.eclipse.osee-22e105c25fe865767d13e8db67931b1f300b081c.tar.xz
org.eclipse.osee-22e105c25fe865767d13e8db67931b1f300b081c.zip
refactor: Use ArtifactId in AttributeData
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImplTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/AttributeData.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImpl.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/ArtifactMatchDataHandler.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryTest.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java62
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryImpl.java9
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeDataImpl.java10
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeObjectFactory.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectFactoryImpl.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/AttributeLoadProcessor.java11
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/QueryFilterFactoryImpl.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/util/LoadDataBuffer.java2
16 files changed, 72 insertions, 71 deletions
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImplTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImplTest.java
index b6b9dad072..7cc2203382 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImplTest.java
@@ -96,7 +96,7 @@ public class GraphBuilderImplTest {
when(relationFactory.createRelation(relationData)).thenReturn(relation);
when(relation.getRelationType()).thenReturn(TYPE_1);
- when(attributeData.getArtifactId()).thenReturn(artifactId60.getIdIntValue());
+ when(attributeData.getArtifactId()).thenReturn(artifactId60);
}
@Test
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 37128de143..dec528c7c5 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
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.ds;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.AttributeId;
/**
@@ -17,9 +18,9 @@ import org.eclipse.osee.framework.core.data.AttributeId;
*/
public interface AttributeData<T> extends OrcsData, AttributeId {
- int getArtifactId();
+ ArtifactId getArtifactId();
- void setArtifactId(int artifactId);
+ void setArtifactId(ArtifactId artifactId);
DataProxy<T> getDataProxy();
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 bd24aeb7bc..789468a776 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
@@ -24,6 +24,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
+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;
@@ -84,13 +85,13 @@ public abstract class AttributeManagerImpl extends BaseId implements HasOrcsData
@Override
public synchronized void add(AttributeTypeId attributeType, Attribute<?> attribute) {
attributes.put(attributeType, (Attribute<Object>) attribute);
- attribute.getOrcsData().setArtifactId(getId().intValue());
+ attribute.getOrcsData().setArtifactId(this);
}
@Override
public synchronized void remove(AttributeTypeId type, Attribute<?> attribute) {
attributes.removeValue(type, (Attribute<Object>) attribute);
- attribute.getOrcsData().setArtifactId(-1);
+ attribute.getOrcsData().setArtifactId(ArtifactId.SENTINEL);
}
@Override
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 3cac52a049..0c333ad882 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
@@ -89,7 +89,7 @@ public class GraphBuilderImpl extends LoadDataHandlerAdapter implements GraphBui
@Override
public <T> void onData(AttributeData<T> data) {
GraphData graph = getGraph();
- AttributeManager container = graph.getNode(ArtifactId.valueOf(data.getArtifactId()));
+ AttributeManager container = graph.getNode(data.getArtifactId());
if (container == null) {
logger.warn("Orphaned attribute detected - data[%s]", data);
} else {
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/ArtifactMatchDataHandler.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/ArtifactMatchDataHandler.java
index 6861476fc8..048dccf279 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/ArtifactMatchDataHandler.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/ArtifactMatchDataHandler.java
@@ -20,6 +20,7 @@ import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.AttributeId;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.jdk.core.type.MatchLocation;
@@ -41,7 +42,7 @@ public class ArtifactMatchDataHandler extends LoadDataHandlerDecorator {
private final OrcsSession session;
private final ExternalArtifactManager proxyManager;
- private Map<Integer, ArtifactMatch> matches;
+ private Map<ArtifactId, ArtifactMatch> matches;
private List<Match<ArtifactReadable, AttributeReadable<?>>> results;
public ArtifactMatchDataHandler(OrcsSession session, GraphBuilder handler, ExternalArtifactManager proxyManager) {
@@ -65,7 +66,7 @@ public class ArtifactMatchDataHandler extends LoadDataHandlerDecorator {
@Override
public <T> void onData(AttributeData<T> data, MatchLocation match) {
super.onData(data, match);
- Integer artId = data.getArtifactId();
+ ArtifactId artId = data.getArtifactId();
synchronized (matches) {
ArtifactMatch artifactMatch = matches.get(artId);
if (artifactMatch == null) {
@@ -86,7 +87,7 @@ public class ArtifactMatchDataHandler extends LoadDataHandlerDecorator {
Iterable<Artifact> loaded = getHandler().getArtifacts();
for (Artifact item : loaded) {
- ArtifactMatch artifactMatch = matches.get(new Long(item.getUuid()).intValue());
+ ArtifactMatch artifactMatch = matches.get(item);
if (artifactMatch != null) {
ArtifactReadable readable = proxyManager.asExternalArtifact(session, item);
artifactMatch.setArtifactReadable(readable);
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 6dbb60dcfd..c20b2c9472 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
@@ -332,7 +332,7 @@ public class MissingChangeItemFactoryTest {
}
private static ChangeItem createExpected(AttributeData data) {
- return ChangeItemUtil.newAttributeChange(data, AttributeTypeId.SENTINEL, ArtifactId.valueOf(data.getArtifactId()),
+ return ChangeItemUtil.newAttributeChange(data, AttributeTypeId.SENTINEL, data.getArtifactId(),
data.getVersion().getGammaId(), determineModType(data), "", ApplicabilityToken.BASE);
}
@@ -358,7 +358,7 @@ public class MissingChangeItemFactoryTest {
DataProxy<?> proxy = mock(DataProxy.class);
AttributeData data = new AttributeDataImpl(version);
- data.setArtifactId(artId.getId().intValue());
+ data.setArtifactId(artId);
data.setModType(modType);
data.setLocalId(attrId);
data.setDataProxy(proxy);
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 5a8c5deb2a..97e60c0334 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
@@ -31,6 +31,7 @@ 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;
import org.eclipse.osee.orcs.core.ds.ArtifactData;
+import org.eclipse.osee.orcs.core.ds.ArtifactDataImpl;
import org.eclipse.osee.orcs.core.ds.AttributeData;
import org.eclipse.osee.orcs.core.ds.DataFactory;
import org.eclipse.osee.orcs.core.ds.DataProxy;
@@ -62,6 +63,10 @@ public class DataFactoryImplTest {
private static final TransactionId tx333 = TransactionId.valueOf(333);
private static final TransactionId tx444 = TransactionId.valueOf(444);
private static final GammaId gamma222 = GammaId.valueOf(222);
+ private static final Long ART_ID = 987L;
+ private static final Long SHARED_ID = 555L;
+ private static final ArtifactId artifactId555 = ArtifactId.valueOf(SHARED_ID);
+ private static final IArtifactType artifactType = CoreArtifactTypes.SoftwareRequirement;
@Rule
public ExpectedException thrown = ExpectedException.none();
@@ -72,19 +77,15 @@ public class DataFactoryImplTest {
@Mock private IdentityLocator identityService;
@Mock private ArtifactTypes artifactCache;
@Mock private RelationTypes relationTypes;
-
- @Mock private ArtifactData artData;
@Mock private AttributeData attrData;
@Mock private VersionData verData;
@Mock private DataProxy<Integer> dataProxy;
@Mock private DataProxy<Integer> otherDataProxy;
-
//@formatter:on
- private final IArtifactType artifactType = CoreArtifactTypes.SoftwareRequirement;
+ private ArtifactData artData;
private final ArtifactId art88 = ArtifactId.valueOf(88);
private final ArtifactId art99 = ArtifactId.valueOf(99);
-
private DataFactory dataFactory;
private final Integer expectedProxyValue = 45;
private final String expectedProxyUri = "hello";
@@ -99,6 +100,7 @@ public class DataFactoryImplTest {
OrcsObjectFactory objectFactory = new OrcsObjectFactoryImpl(proxyFactory, relationTypes);
dataFactory = new DataFactoryImpl(idFactory, objectFactory, artifactCache);
+ when(idFactory.getNextArtifactId()).thenReturn(ART_ID.intValue());
// VERSION
when(verData.getBranch()).thenReturn(BRANCH);
@@ -108,22 +110,22 @@ public class DataFactoryImplTest {
when(verData.isHistorical()).thenReturn(true);
// ARTIFACT
- when(artData.getVersion()).thenReturn(verData);
- when(artData.getLocalId()).thenReturn(555);
- when(artData.getModType()).thenReturn(ModificationType.MODIFIED);
- when(artData.getTypeUuid()).thenReturn(666L);
- when(artData.getBaseModType()).thenReturn(ModificationType.NEW);
- when(artData.getBaseTypeUuid()).thenReturn(777L);
- when(artData.getGuid()).thenReturn("abcdefg");
+ artData = new ArtifactDataImpl(verData);
+ artData.setLocalId(SHARED_ID.intValue());
+ artData.setModType(ModificationType.MODIFIED);
+ artData.setTypeUuid(666L);
+ artData.setBaseModType(ModificationType.NEW);
+ artData.setBaseTypeUuid(777L);
// ATTRIBUTE
when(attrData.getVersion()).thenReturn(verData);
- when(attrData.getLocalId()).thenReturn(555);
+ 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.getBaseModType()).thenReturn(ModificationType.NEW);
when(attrData.getBaseTypeUuid()).thenReturn(777L);
- when(attrData.getArtifactId()).thenReturn(art88.getId().intValue());
+ when(attrData.getArtifactId()).thenReturn(art88);
when(attrData.getDataProxy()).thenReturn(dataProxy);
when(dataProxy.getRawValue()).thenReturn(expectedProxyValue);
@@ -134,7 +136,7 @@ public class DataFactoryImplTest {
// RELATION
relData = new RelationDataImpl(verData);
- relData.setLocalId(555);
+ relData.setLocalId(SHARED_ID.intValue());
relData.setModType(ModificationType.MODIFIED);
relData.setTypeUuid(666);
relData.setBaseModType(ModificationType.NEW);
@@ -170,7 +172,6 @@ public class DataFactoryImplTest {
public void testCreateArtifactData() {
when(artifactCache.isAbstract(artifactType)).thenReturn(false);
when(idFactory.getUniqueGuid(guid)).thenReturn(guid);
- when(idFactory.getNextArtifactId()).thenReturn(987);
ArtifactData actual = dataFactory.create(COMMON, artifactType, guid);
verify(idFactory).getUniqueGuid(guid);
@@ -185,7 +186,7 @@ public class DataFactoryImplTest {
assertEquals(false, actualVer.isHistorical());
assertEquals(false, actualVer.isInStorage());
- assertEquals(987, actual.getLocalId().intValue());
+ assertEquals(ART_ID, actual.getId());
assertEquals(RelationalConstants.DEFAULT_MODIFICATION_TYPE, actual.getModType());
assertEquals(artifactType, actual.getTypeUuid());
assertEquals(RelationalConstants.DEFAULT_MODIFICATION_TYPE, actual.getBaseModType());
@@ -198,7 +199,6 @@ public class DataFactoryImplTest {
when(artifactCache.get(artifactType)).thenReturn(artifactType);
when(artifactCache.isAbstract(artifactType)).thenReturn(false);
when(idFactory.getUniqueGuid(guid)).thenReturn(guid);
- when(idFactory.getNextArtifactId()).thenReturn(987);
ArtifactData actual = dataFactory.create(COMMON, artifactType, guid);
verify(idFactory).getUniqueGuid(guid);
@@ -212,7 +212,7 @@ public class DataFactoryImplTest {
assertEquals(false, actualVer.isHistorical());
assertEquals(false, actualVer.isInStorage());
- assertEquals(987, actual.getLocalId().intValue());
+ assertEquals(ART_ID, actual.getId());
assertEquals(RelationalConstants.DEFAULT_MODIFICATION_TYPE, actual.getModType());
assertEquals(artifactType, actual.getTypeUuid());
assertEquals(RelationalConstants.DEFAULT_MODIFICATION_TYPE, actual.getBaseModType());
@@ -246,7 +246,7 @@ public class DataFactoryImplTest {
assertEquals(RelationalConstants.DEFAULT_MODIFICATION_TYPE, actual.getBaseModType());
assertEquals(attributeType.getId().longValue(), actual.getBaseTypeUuid());
- assertEquals(555, actual.getArtifactId());
+ assertEquals(artifactId555, actual.getArtifactId());
assertNotSame(dataProxy, actual.getDataProxy());
}
@@ -292,12 +292,11 @@ public class DataFactoryImplTest {
assertEquals(false, actualVer.isHistorical());
assertEquals(false, actualVer.isInStorage());
- assertEquals(555, actual.getLocalId().intValue());
+ assertEquals(artifactId555, actual);
assertEquals(artData.getModType(), actual.getModType());
assertEquals(666L, actual.getTypeUuid());
assertEquals(ModificationType.NEW, actual.getBaseModType());
assertEquals(777L, actual.getBaseTypeUuid());
- assertEquals("abcdefg", actual.getGuid());
}
@Test
@@ -313,13 +312,13 @@ public class DataFactoryImplTest {
assertEquals(false, actualVer.isHistorical());
assertEquals(false, actualVer.isInStorage());
- assertEquals(555, actual.getLocalId().intValue());
+ assertEquals(SHARED_ID, actual.getId());
assertEquals(attrData.getModType(), actual.getModType());
assertEquals(666L, actual.getTypeUuid());
assertEquals(ModificationType.NEW, actual.getBaseModType());
assertEquals(777L, actual.getBaseTypeUuid());
- assertEquals(art88, Long.valueOf(actual.getArtifactId()));
+ assertEquals(art88, actual.getArtifactId());
assertNotSame(dataProxy, actual.getDataProxy());
assertEquals(expectedProxyValue, actual.getDataProxy().getRawValue());
@@ -329,7 +328,7 @@ public class DataFactoryImplTest {
@Test
public void testCopyArtifactData() {
String newGuid = GUID.create();
- when(idFactory.getNextArtifactId()).thenReturn(987);
+
when(idFactory.getUniqueGuid(null)).thenReturn(newGuid);
ArtifactData actual = dataFactory.copy(COMMON, artData);
@@ -344,7 +343,7 @@ public class DataFactoryImplTest {
assertEquals(false, actualVer.isHistorical());
assertEquals(false, actualVer.isInStorage());
- assertEquals(987, actual.getLocalId().intValue());
+ assertEquals(ART_ID, actual.getId());
assertEquals(ModificationType.NEW, actual.getModType());
assertEquals(666L, actual.getTypeUuid());
assertEquals(ModificationType.NEW, actual.getBaseModType());
@@ -371,7 +370,7 @@ public class DataFactoryImplTest {
assertEquals(ModificationType.NEW, actual.getBaseModType());
assertEquals(777L, actual.getBaseTypeUuid());
- assertEquals(art88, Long.valueOf(actual.getArtifactId()));
+ assertEquals(art88, actual.getArtifactId());
assertNotSame(dataProxy, actual.getDataProxy());
assertEquals(expectedProxyValue, actual.getDataProxy().getRawValue());
@@ -393,12 +392,11 @@ public class DataFactoryImplTest {
assertEquals(true, actualVer.isHistorical());
assertEquals(true, actualVer.isInStorage());
- assertEquals(555, actual.getLocalId().intValue());
+ assertEquals(artifactId555, actual);
assertEquals(ModificationType.MODIFIED, actual.getModType());
assertEquals(666L, actual.getTypeUuid());
assertEquals(ModificationType.NEW, actual.getBaseModType());
assertEquals(777L, actual.getBaseTypeUuid());
- assertEquals("abcdefg", actual.getGuid());
}
@Test
@@ -418,13 +416,13 @@ public class DataFactoryImplTest {
assertEquals(true, actualVer.isHistorical());
assertEquals(true, actualVer.isInStorage());
- assertEquals(555, actual.getLocalId().intValue());
+ assertEquals(SHARED_ID, actual.getId());
assertEquals(ModificationType.MODIFIED, actual.getModType());
assertEquals(666L, actual.getTypeUuid());
assertEquals(ModificationType.NEW, actual.getBaseModType());
assertEquals(777L, actual.getBaseTypeUuid());
- assertEquals(art88, Long.valueOf(actual.getArtifactId()));
+ assertEquals(art88, actual.getArtifactId());
assertNotSame(dataProxy, actual.getDataProxy());
assertEquals(expectedProxyValue, actual.getDataProxy().getRawValue());
@@ -446,7 +444,7 @@ public class DataFactoryImplTest {
assertEquals(true, actualVer.isHistorical());
assertEquals(true, actualVer.isInStorage());
- assertEquals(555, actual.getLocalId().intValue());
+ assertEquals(SHARED_ID, actual.getId());
assertEquals(ModificationType.MODIFIED, actual.getModType());
assertEquals(666L, actual.getTypeUuid());
assertEquals(ModificationType.NEW, actual.getBaseModType());
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 beb7c8846f..9cda0dceab 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
@@ -91,7 +91,7 @@ public class TxSqlBuilderTest {
private static final ArtifactId B_ART_ID = ArtifactId.valueOf(1231);
private static final String RATIONALE = "a rationale";
- private static final int ATTR_ARTIFACT_ID = 12341242;
+ private static final ArtifactId ATTR_ARTIFACT_ID = ArtifactId.valueOf(12341242);
private static final String ATTR_URI = "attr://123/123/123/14/some.zip";
private static final String ATTR_VALUE = "ksahfkashfdlakshfashfaer";
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 1bb30a47a4..f2620a3c2b 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
@@ -163,7 +163,7 @@ public class MissingChangeItemFactoryImpl implements MissingChangeItemFactory {
@Override
public <T> void onData(AttributeData<T> data) {
- if (!modifiedAttrIds.get(ArtifactId.valueOf(data.getArtifactId())).contains(data)) {
+ if (!modifiedAttrIds.get(data.getArtifactId()).contains(data)) {
toReturn.add(createAttributeChangeItem(data));
}
}
@@ -226,10 +226,10 @@ public class MissingChangeItemFactoryImpl implements MissingChangeItemFactory {
return artChange;
}
- private ChangeItem createAttributeChangeItem(AttributeData data) {
+ private ChangeItem createAttributeChangeItem(AttributeData<?> data) {
ApplicabilityId appId = data.getApplicabilityId();
ChangeItem attrChange = ChangeItemUtil.newAttributeChange(data, AttributeTypeId.valueOf(data.getTypeUuid()),
- ArtifactId.valueOf(data.getArtifactId()), data.getVersion().getGammaId(), determineModType(data),
+ data.getArtifactId(), data.getVersion().getGammaId(), determineModType(data),
data.getDataProxy().getDisplayableString(), getApplicabilityToken(appId));
attrChange.getNetChange().copy(attrChange.getCurrentVersion());
return attrChange;
@@ -241,5 +241,4 @@ public class MissingChangeItemFactoryImpl implements MissingChangeItemFactory {
RelationTypeId.valueOf(data.getTypeUuid()), 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 f72062880c..fa170b813d 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
@@ -105,8 +105,8 @@ public class DataFactoryImpl implements DataFactory {
VersionData version = objectFactory.createDefaultVersionData();
version.setBranch(parent.getVersion().getBranch());
ModificationType modType = RelationalConstants.DEFAULT_MODIFICATION_TYPE;
- return objectFactory.createAttributeData(version, idFactory.getNextAttributeId(), attributeType, modType,
- parent.getLocalId(), ApplicabilityId.BASE);
+ return objectFactory.createAttributeData(version, idFactory.getNextAttributeId(), attributeType, modType, parent,
+ ApplicabilityId.BASE);
}
@Override
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 7f85b6bba1..c86f9e12d0 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
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.loader.data;
-import org.eclipse.osee.framework.core.data.RelationalConstants;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.orcs.core.ds.AttributeData;
import org.eclipse.osee.orcs.core.ds.DataProxy;
import org.eclipse.osee.orcs.core.ds.OrcsVersionedObjectImpl;
@@ -21,7 +21,7 @@ import org.eclipse.osee.orcs.core.ds.VersionData;
*/
public class AttributeDataImpl<T> extends OrcsVersionedObjectImpl implements AttributeData<T> {
- private int artifactId = RelationalConstants.ART_ID_SENTINEL;
+ private ArtifactId artifactId = ArtifactId.SENTINEL;
private boolean useBackingData = false;
private DataProxy<T> proxy;
@@ -31,7 +31,7 @@ public class AttributeDataImpl<T> extends OrcsVersionedObjectImpl implements Att
}
@Override
- public int getArtifactId() {
+ public ArtifactId getArtifactId() {
return artifactId;
}
@@ -41,7 +41,7 @@ public class AttributeDataImpl<T> extends OrcsVersionedObjectImpl implements Att
}
@Override
- public void setArtifactId(int artifactId) {
+ public void setArtifactId(ArtifactId artifactId) {
this.artifactId = artifactId;
}
@@ -57,7 +57,7 @@ public class AttributeDataImpl<T> extends OrcsVersionedObjectImpl implements Att
}
if (obj instanceof AttributeDataImpl) {
AttributeDataImpl<?> other = (AttributeDataImpl<?>) obj;
- return Integer.valueOf(other.artifactId).equals(artifactId) && proxy.equals(other.proxy);
+ return other.artifactId.equals(artifactId) && proxy.equals(other.proxy);
}
return true;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeObjectFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeObjectFactory.java
index f1715a13a4..27db897e56 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeObjectFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeObjectFactory.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.orcs.db.internal.loader.data;
import org.eclipse.osee.framework.core.data.ApplicabilityId;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.orcs.core.ds.AttributeData;
@@ -21,9 +22,9 @@ import org.eclipse.osee.orcs.core.ds.VersionData;
*/
public interface AttributeObjectFactory extends VersionObjectFactory {
- <T> AttributeData<T> createAttributeData(VersionData version, Integer id, AttributeTypeToken attributeType, ModificationType modType, int artId, T value, String uri, ApplicabilityId applicId);
+ <T> AttributeData<T> createAttributeData(VersionData version, Integer id, AttributeTypeToken attributeType, ModificationType modType, ArtifactId artId, T value, String uri, ApplicabilityId applicId);
- <T> AttributeData<T> createAttributeData(VersionData version, Integer id, AttributeTypeToken attributeType, ModificationType modType, int artId, ApplicabilityId applicId);
+ <T> AttributeData<T> createAttributeData(VersionData version, Integer id, AttributeTypeToken attributeType, ModificationType modType, ArtifactId artId, ApplicabilityId applicId);
<T> AttributeData<T> createCopy(AttributeData<T> 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/OrcsObjectFactoryImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectFactoryImpl.java
index 3b9beeb512..472854f87b 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
@@ -108,7 +108,7 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
}
@Override
- public <T> AttributeData<T> createAttributeData(VersionData version, Integer id, AttributeTypeToken attributeType, ModificationType modType, int artifactId, T value, String uri, ApplicabilityId applicId) {
+ 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);
@@ -126,7 +126,7 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
}
@Override
- public <T> AttributeData<T> createAttributeData(VersionData version, Integer id, AttributeTypeToken attributeType, ModificationType modType, int artId, ApplicabilityId applicId) {
+ 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);
@@ -156,7 +156,7 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
return data;
}
- private <T> AttributeData<T> createAttributeFromRow(VersionData version, int id, long localTypeID, ModificationType modType, long baseLocalTypeID, ModificationType baseModType, int artifactId, DataProxy<T> proxy, ApplicabilityId applicId) {
+ private <T> AttributeData<T> createAttributeFromRow(VersionData version, int id, long localTypeID, ModificationType modType, long baseLocalTypeID, ModificationType baseModType, ArtifactId artifactId, DataProxy<T> proxy, ApplicabilityId applicId) {
AttributeData<T> data = new AttributeDataImpl<>(version);
data.setLocalId(id);
data.setTypeUuid(localTypeID);
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/AttributeLoadProcessor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/AttributeLoadProcessor.java
index d8762167cb..b20f291c41 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/AttributeLoadProcessor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/AttributeLoadProcessor.java
@@ -47,7 +47,7 @@ public class AttributeLoadProcessor extends LoadProcessor<AttributeData, Attribu
AttributeData toReturn = null;
BranchId branch = BranchId.create(chStmt.getLong("branch_id"), OptionsUtil.getFromBranchView(options));
- int artId = chStmt.getInt("id2");
+ ArtifactId artId = ArtifactId.valueOf(chStmt.getLong("id2"));
int attrId = chStmt.getInt("attr_id");
GammaId gammaId = GammaId.valueOf(chStmt.getLong("gamma_id"));
ModificationType modType = ModificationType.valueOf(chStmt.getInt("mod_type"));
@@ -121,23 +121,22 @@ public class AttributeLoadProcessor extends LoadProcessor<AttributeData, Attribu
}
private static final class CreateConditions {
- int previousArtId = -1;
+ ArtifactId previousArtId = ArtifactId.SENTINEL;
BranchId previousBranchId = BranchId.SENTINEL;
int previousAttrId = -1;
GammaId previousGammaId = GammaId.SENTINEL;
ModificationType previousModType = null;
- boolean isSame(BranchId branch, int artifactId, int attrId) {
- return previousBranchId.equals(branch) && previousArtId == artifactId && previousAttrId == attrId;
+ boolean isSame(BranchId branch, ArtifactId artifactId, int attrId) {
+ return previousBranchId.equals(branch) && previousArtId.equals(artifactId) && previousAttrId == attrId;
}
- void saveConditions(BranchId branch, int artifactId, int attrId, GammaId gammaId, ModificationType modType) {
+ void saveConditions(BranchId branch, ArtifactId artifactId, int attrId, GammaId gammaId, ModificationType modType) {
previousBranchId = branch;
previousArtId = artifactId;
previousAttrId = attrId;
previousGammaId = gammaId;
previousModType = modType;
}
-
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/QueryFilterFactoryImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/QueryFilterFactoryImpl.java
index 7bb27ebb54..9019a48745 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/QueryFilterFactoryImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/QueryFilterFactoryImpl.java
@@ -152,7 +152,7 @@ public class QueryFilterFactoryImpl implements QueryFilterFactory {
CriteriaMatchTracker tracker = artIdToCriteriaTracker.get(item.getArtifactId());
if (tracker == null) {
tracker = new CriteriaMatchTracker(criterias);
- artIdToCriteriaTracker.put(item.getArtifactId(), tracker);
+ artIdToCriteriaTracker.put(item.getArtifactId().getIdIntValue(), tracker);
}
checkForCancelled();
List<MatchLocation> matches = process(this, item, handler, tracker.remainingCriteriaToMatch);
@@ -252,8 +252,9 @@ public class QueryFilterFactoryImpl implements QueryFilterFactory {
@Override
public <T> void onData(AttributeData<T> data, MatchLocation match) {
- acceptedArtIds.add(data.getArtifactId());
- forwardArtifacts(data.getArtifactId());
+ Integer artId = data.getArtifactId().getIdIntValue();
+ acceptedArtIds.add(artId);
+ forwardArtifacts(artId);
super.onData(data, match);
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/util/LoadDataBuffer.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/util/LoadDataBuffer.java
index 045d89624d..611e7f5c62 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/util/LoadDataBuffer.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/util/LoadDataBuffer.java
@@ -52,7 +52,7 @@ public class LoadDataBuffer {
public void addData(AttributeData<?> data) {
synchronized (attributes) {
- attributes.put(data.getArtifactId(), data);
+ attributes.put(data.getArtifactId().getIdIntValue(), data);
}
}

Back to the top