Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2017-08-02 19:04:02 -0400
committerRyan D. Brooks2017-08-07 17:58:43 -0400
commitf7574e2c51869931030b69c9723cafec41ad90e9 (patch)
treecc0d4f9dfe334f60cf50c5a4b8934814be5be040
parent17117a2556dddf776f2a58daa62aca019f681e77 (diff)
downloadorg.eclipse.osee-f7574e2c51869931030b69c9723cafec41ad90e9.tar.gz
org.eclipse.osee-f7574e2c51869931030b69c9723cafec41ad90e9.tar.xz
org.eclipse.osee-f7574e2c51869931030b69c9723cafec41ad90e9.zip
refactor: Use GammaId in VersionData
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/RelationalConstants.java1
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/VersionData.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/relation/Relation.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/LoaderTest.java60
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryTest.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java27
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/DaoToSqlTest.java33
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java14
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryImpl.java14
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectFactoryImpl.java9
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/VersionDataImpl.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/VersionObjectFactory.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/ArtifactLoadProcessor.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/AttributeLoadProcessor.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/RelationLoadProcessor.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/DaoToSql.java9
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionIndexer.java2
21 files changed, 121 insertions, 104 deletions
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/RelationalConstants.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/RelationalConstants.java
index e0aad179cd..89778ffb1a 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/RelationalConstants.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/RelationalConstants.java
@@ -22,7 +22,6 @@ public final class RelationalConstants {
}
public static final int JOIN_QUERY_ID_SENTINEL = -1;
- public static final long GAMMA_SENTINEL = -1;
public static final boolean IS_HISTORICAL_DEFAULT = false;
public static final int ART_ID_SENTINEL = -1;
public static final String DEFAULT_RATIONALE = "";
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/VersionData.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/VersionData.java
index c177b481ed..7f910e9968 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/VersionData.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/VersionData.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.orcs.core.ds;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.data.TransactionId;
/**
@@ -18,7 +19,7 @@ import org.eclipse.osee.framework.core.data.TransactionId;
*/
public interface VersionData extends Cloneable {
- long getGammaId();
+ GammaId getGammaId();
void setGammaId(long gamma);
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 b14863584e..25f8fa7711 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
@@ -276,7 +276,7 @@ public abstract class AttributeImpl<T> implements Comparable<AttributeImpl<T>>,
@Override
public long getGammaId() {
- return getOrcsData().getVersion().getGammaId();
+ return getOrcsData().getVersion().getGammaId().getId();
}
public void internalSetGammaId(int gammaId) {
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 df1355cbe6..14e5bcce91 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
@@ -177,7 +177,7 @@ public class Relation implements RelationReadable, HasOrcsData<RelationData>, Or
@Override
public long getGammaId() {
- return getOrcsData().getVersion().getGammaId();
+ return getOrcsData().getVersion().getGammaId().getId();
}
@Override
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java
index 87b0e31386..bb52740202 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java
@@ -239,19 +239,19 @@ public class TxDataManager {
public Long createTuple2(TxData txData, BranchId branch, Long tupleTypeId, Long e1, Long e2) {
TupleData tuple = tupleFactory.createTuple2Data(tupleTypeId, branch, e1, e2);
txData.add(tuple);
- return tuple.getVersion().getGammaId();
+ return tuple.getVersion().getGammaId().getId();
}
public Long createTuple3(TxData txData, BranchId branch, Long tupleTypeId, Long e1, Long e2, Long e3) {
TupleData tuple = tupleFactory.createTuple3Data(tupleTypeId, branch, e1, e2, e3);
txData.add(tuple);
- return tuple.getVersion().getGammaId();
+ return tuple.getVersion().getGammaId().getId();
}
public Long createTuple4(TxData txData, BranchId branch, Long tupleTypeId, Long e1, Long e2, Long e3, Long e4) {
TupleData tuple = tupleFactory.createTuple4Data(tupleTypeId, branch, e1, e2, e3, e4);
txData.add(tuple);
- return tuple.getVersion().getGammaId();
+ return tuple.getVersion().getGammaId().getId();
}
public ArtifactReadable createArtifact(TxData txData, IArtifactType artifactType, String name, String guid) throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/LoaderTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/LoaderTest.java
index 1d6588f614..41c8262310 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/LoaderTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/LoaderTest.java
@@ -37,6 +37,7 @@ import org.eclipse.osee.executor.admin.HasCancellation;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.AttributeId;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.enums.CoreArtifactTokens;
@@ -104,27 +105,34 @@ public class LoaderTest {
private static ArtifactReadable OseeTypesFrameworkArt;
private static AttributeId OseeTypesFrameworkNameAttrId;
private static AttributeId OseeTypesFrameworkActiveAttrId;
- private static long OseeTypesFrameworkActiveGammaId, OseeTypesFrameworkNameGammaId;
+ private static GammaId OseeTypesFrameworkActiveGammaId;
+ private static GammaId OseeTypesFrameworkActiveGammaIdPlus1;
+ private static GammaId OseeTypesFrameworkActiveGammaIdPlus2;
+ private static GammaId OseeTypesFrameworkNameGammaId;
private static String OseeTypesFrameworkGuid;
private static ArtifactReadable OseeTypesClientDemoArt;
private static AttributeId OseeTypesClientDemoActiveAttrId;
private static AttributeId OseeTypesClientDemoActiveAttrIdPlus1;
private static AttributeId OseeTypesClientDemoActiveAttrIdPlus2;
private static AttributeId OseeTypesClientDemoNameAttrId;
- private static long OseeTypesClientDemoActiveGammaId, OseeTypesClientDemoNameGammaId;
+ private static GammaId OseeTypesClientDemoActiveGammaId;
+ private static GammaId OseeTypesClientDemoActiveGammaIdPlus1;
+ private static GammaId OseeTypesClientDemoActiveGammaIdPlus2;
+ private static GammaId OseeTypesClientDemoNameGammaId;
private static String OseeTypesClientDemoGuid;
- private static final long UserGroupsArtifactGammaId = 43L, OseeTypesClientDemoGammaId = 11L,
- OseeTypesFrameworkGammaId = 8L;
+ private static final GammaId UserGroupsArtifactGammaId = GammaId.valueOf(43);
+ private static final GammaId OseeTypesClientDemoGammaId = GammaId.valueOf(11);
+ private static final GammaId OseeTypesFrameworkGammaId = GammaId.valueOf(8);
private static AttributeId UserGroupsNameAttrId;
- private static long UserGroupsNameGammaId;
+ private static GammaId UserGroupsNameGammaId;
private static final Map<ArtifactToken, Integer> artTokenToRelationId = new HashMap<>();
- private static final Map<ArtifactToken, Long> artTokenToRelationGammaId = new HashMap<>();
+ private static final Map<ArtifactToken, GammaId> artTokenToRelationGammaId = new HashMap<>();
private final String UserGroupsGuid = CoreArtifactTokens.UserGroups.getGuid();
private static final List<ArtifactToken> relationsArts =
Arrays.asList(CoreArtifactTokens.Everyone, CoreArtifactTokens.DefaultHierarchyRoot, CoreArtifactTokens.OseeAdmin,
CoreArtifactTokens.OseeAccessAdmin, AtsTempAdminToken, AtsAdminToken);
- private static long defaultHierRootToUserGroupsRelationGammaId;
- private static long userGroupsToOseeAdminRelationGammaId;
+ private static GammaId defaultHierRootToUserGroupsRelationGammaId;
+ private static GammaId userGroupsToOseeAdminRelationGammaId;
// Transaction that OseeTypes_ClientDemo and OseeTypes_Framework were created in
private final TransactionId tx5 = TransactionId.valueOf(5);
// Transaction that User Groups was created in
@@ -151,10 +159,12 @@ public class LoaderTest {
for (AttributeReadable<Object> attr : art.getAttributes()) {
if (attr.isOfType(CoreAttributeTypes.Active)) {
OseeTypesFrameworkActiveAttrId = attr;
- OseeTypesFrameworkActiveGammaId = Long.valueOf(attr.getGammaId());
+ OseeTypesFrameworkActiveGammaId = GammaId.valueOf(attr.getGammaId());
+ OseeTypesFrameworkActiveGammaIdPlus1 = GammaId.valueOf(attr.getGammaId() + 1);
+ OseeTypesFrameworkActiveGammaIdPlus2 = GammaId.valueOf(attr.getGammaId() + 2);
} else if (attr.isOfType(CoreAttributeTypes.Name)) {
OseeTypesFrameworkNameAttrId = attr;
- OseeTypesFrameworkNameGammaId = Long.valueOf(attr.getGammaId());
+ OseeTypesFrameworkNameGammaId = GammaId.valueOf(attr.getGammaId());
}
}
} else if (art.getName().contains("OseeTypes_ClientDemo")) {
@@ -168,10 +178,12 @@ public class LoaderTest {
AttributeId.valueOf(OseeTypesClientDemoActiveAttrId.getId() + 1);
OseeTypesClientDemoActiveAttrIdPlus2 =
AttributeId.valueOf(OseeTypesClientDemoActiveAttrId.getId() + 2);
- OseeTypesClientDemoActiveGammaId = attr.getGammaId();
+ OseeTypesClientDemoActiveGammaId = GammaId.valueOf(attr.getGammaId());
+ OseeTypesClientDemoActiveGammaIdPlus1 = GammaId.valueOf(attr.getGammaId() + 1);
+ OseeTypesClientDemoActiveGammaIdPlus2 = GammaId.valueOf(attr.getGammaId() + 2);
} else if (attr.isOfType(CoreAttributeTypes.Name)) {
OseeTypesClientDemoNameAttrId = attr;
- OseeTypesClientDemoNameGammaId = Long.valueOf(attr.getGammaId());
+ OseeTypesClientDemoNameGammaId = GammaId.valueOf(attr.getGammaId());
}
}
}
@@ -182,14 +194,14 @@ public class LoaderTest {
for (AttributeReadable<Object> attr : userGroupFolder.getAttributes()) {
if (attr.isOfType(CoreAttributeTypes.Name)) {
UserGroupsNameAttrId = attr;
- UserGroupsNameGammaId = attr.getGammaId();
+ UserGroupsNameGammaId = GammaId.valueOf(attr.getGammaId());
}
}
ArtifactReadable defaultHierRoot = orcsApi.getQueryFactory().fromBranch(CoreBranches.COMMON).andId(
CoreArtifactTokens.DefaultHierarchyRoot).getResults().getExactlyOne();
for (RelationReadable relation : defaultHierRoot.getRelations(CoreRelationTypes.Default_Hierarchical__Child)) {
if (relation.getArtIdB() == CoreArtifactTokens.UserGroups.getId().intValue()) {
- defaultHierRootToUserGroupsRelationGammaId = relation.getGammaId();
+ defaultHierRootToUserGroupsRelationGammaId = GammaId.valueOf(relation.getGammaId());
break;
}
}
@@ -197,11 +209,11 @@ public class LoaderTest {
for (ArtifactToken token : relationsArts) {
if (rel.getArtIdB() == token.getId().intValue() || rel.getArtIdA() == token.getId().intValue()) {
artTokenToRelationId.put(token, rel.getId().intValue());
- artTokenToRelationGammaId.put(token, rel.getGammaId());
+ artTokenToRelationGammaId.put(token, GammaId.valueOf(rel.getGammaId()));
}
}
if (rel.getArtIdB() == CoreArtifactTokens.OseeAdmin.getId().intValue()) {
- userGroupsToOseeAdminRelationGammaId = rel.getGammaId();
+ userGroupsToOseeAdminRelationGammaId = GammaId.valueOf(rel.getGammaId());
}
}
Assert.assertEquals(6, relationsArts.size());
@@ -263,19 +275,19 @@ public class LoaderTest {
verifyData(attrs.next(), OseeTypesFrameworkActiveAttrId, OseeTypesFrameworkId, NEW, Active.getId(), COMMON, tx5,
OseeTypesFrameworkActiveGammaId, true, "");
verifyData(attrs.next(), AttributeId.valueOf(OseeTypesFrameworkActiveAttrId.getId() + 1), OseeTypesFrameworkId,
- NEW, Name.getId(), COMMON, tx5, OseeTypesFrameworkActiveGammaId + 1,
+ NEW, Name.getId(), COMMON, tx5, OseeTypesFrameworkActiveGammaIdPlus1,
"org.eclipse.osee.framework.skynet.core.OseeTypes_Framework", "");
verifyData(attrs.next(), AttributeId.valueOf(OseeTypesFrameworkActiveAttrId.getId() + 2), OseeTypesFrameworkId,
- NEW, UriGeneralStringData.getId(), COMMON, tx5, OseeTypesFrameworkActiveGammaId + 2, "",
- "attr://" + (OseeTypesFrameworkActiveGammaId + 2) + "/" + OseeTypesFrameworkGuid + ".zip");
+ NEW, UriGeneralStringData.getId(), COMMON, tx5, OseeTypesFrameworkActiveGammaIdPlus2, "",
+ "attr://" + OseeTypesFrameworkActiveGammaIdPlus2.getIdString() + "/" + OseeTypesFrameworkGuid + ".zip");
verifyData(attrs.next(), OseeTypesClientDemoActiveAttrId, OseeTypesClientDemoId, NEW, Active.getId(), COMMON, tx5,
OseeTypesClientDemoActiveGammaId, true, "");
verifyData(attrs.next(), OseeTypesClientDemoActiveAttrIdPlus1, OseeTypesClientDemoId, NEW, Name.getId(), COMMON,
- tx5, OseeTypesClientDemoActiveGammaId + 1, "org.eclipse.osee.client.demo.OseeTypes_ClientDemo", "");
+ tx5, OseeTypesClientDemoActiveGammaIdPlus1, "org.eclipse.osee.client.demo.OseeTypes_ClientDemo", "");
verifyData(attrs.next(), OseeTypesClientDemoActiveAttrIdPlus2, OseeTypesClientDemoId, NEW,
- UriGeneralStringData.getId(), COMMON, tx5, OseeTypesClientDemoActiveGammaId + 2, "",
- "attr://" + (OseeTypesClientDemoActiveGammaId + 2) + "/" + OseeTypesClientDemoGuid + ".zip");
+ UriGeneralStringData.getId(), COMMON, tx5, OseeTypesClientDemoActiveGammaIdPlus2, "",
+ "attr://" + OseeTypesClientDemoActiveGammaIdPlus2.getIdString() + "/" + OseeTypesClientDemoGuid + ".zip");
verifyData(attrs.next(), UserGroupsNameAttrId, UserGroups, NEW, Name.getId(), COMMON, tx7, UserGroupsNameGammaId,
"User Groups", "");
@@ -389,9 +401,9 @@ public class LoaderTest {
Iterator<AttributeData> attrs = attributeCaptor.getAllValues().iterator();
verifyData(attrs.next(), frameworkActiveAttr, OseeTypesFrameworkId, NEW, Active.getId(), COMMON, tx5,
- frameworkActiveAttr.getGammaId(), true, "");
+ GammaId.valueOf(frameworkActiveAttr.getGammaId()), true, "");
verifyData(attrs.next(), clientDemoActiveAttr, OseeTypesClientDemoId, NEW, Active.getId(), COMMON, tx5,
- clientDemoActiveAttr.getGammaId(), true, "");
+ GammaId.valueOf(clientDemoActiveAttr.getGammaId()), true, "");
sort(relationCaptor.getAllValues());
Iterator<RelationData> rels = relationCaptor.getAllValues().iterator();
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 53c7351f57..db3fae10a2 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
@@ -326,18 +326,18 @@ public class MissingChangeItemFactoryTest {
private static ChangeItem createExpected(RelationData data) {
return ChangeItemUtil.newRelationChange(RelationId.valueOf(data.getLocalId()), RelationTypeId.SENTINEL,
- GammaId.valueOf(data.getVersion().getGammaId()), determineModType(data), ArtifactId.valueOf(data.getArtIdA()),
+ data.getVersion().getGammaId(), determineModType(data), ArtifactId.valueOf(data.getArtIdA()),
ArtifactId.valueOf(data.getArtIdB()), "", ApplicabilityToken.BASE);
}
private static ChangeItem createExpected(AttributeData data) {
return ChangeItemUtil.newAttributeChange(data, AttributeTypeId.SENTINEL, ArtifactId.valueOf(data.getArtifactId()),
- GammaId.valueOf(data.getVersion().getGammaId()), determineModType(data), "", ApplicabilityToken.BASE);
+ data.getVersion().getGammaId(), determineModType(data), "", ApplicabilityToken.BASE);
}
private static ChangeItem createExpected(ArtifactData data) {
return ChangeItemUtil.newArtifactChange(ArtifactId.valueOf(data.getLocalId()), ArtifactTypeId.SENTINEL,
- GammaId.valueOf(data.getVersion().getGammaId()), determineModType(data), ApplicabilityToken.BASE);
+ data.getVersion().getGammaId(), determineModType(data), ApplicabilityToken.BASE);
}
private ChangeItem getMatchingChangeItem(ChangeItem item) {
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 6cf95bb0f8..60e0dc7c41 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
@@ -18,8 +18,8 @@ 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.AttributeTypeId;
-import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.RelationTypeId;
import org.eclipse.osee.framework.core.data.RelationalConstants;
@@ -57,6 +57,7 @@ public class DataFactoryImplTest {
private static final BranchId BRANCH = BranchId.valueOf(11);
private static final TransactionId tx333 = TransactionId.valueOf(333);
private static final TransactionId tx444 = TransactionId.valueOf(444);
+ private static final GammaId gamma222 = GammaId.valueOf(222);
@Rule
public ExpectedException thrown = ExpectedException.none();
@@ -95,7 +96,7 @@ public class DataFactoryImplTest {
// VERSION
when(verData.getBranch()).thenReturn(BRANCH);
- when(verData.getGammaId()).thenReturn(222L);
+ when(verData.getGammaId()).thenReturn(gamma222);
when(verData.getTransactionId()).thenReturn(tx333);
when(verData.getStripeId()).thenReturn(tx444);
when(verData.isHistorical()).thenReturn(true);
@@ -175,7 +176,7 @@ public class DataFactoryImplTest {
VersionData actualVer = actual.getVersion();
assertEquals(COMMON, actualVer.getBranch());
- assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
+ assertEquals(GammaId.SENTINEL, actualVer.getGammaId());
assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
assertEquals(TransactionId.SENTINEL, actualVer.getStripeId());
assertEquals(false, actualVer.isHistorical());
@@ -203,7 +204,7 @@ public class DataFactoryImplTest {
VersionData actualVer = actual.getVersion();
assertEquals(COMMON, actualVer.getBranch());
- assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
+ assertEquals(GammaId.SENTINEL, actualVer.getGammaId());
assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
assertEquals(TransactionId.SENTINEL, actualVer.getStripeId());
assertEquals(false, actualVer.isHistorical());
@@ -230,7 +231,7 @@ public class DataFactoryImplTest {
VersionData actualVer = actual.getVersion();
assertEquals(BRANCH, actualVer.getBranch());
- assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
+ assertEquals(GammaId.SENTINEL, actualVer.getGammaId());
assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
assertEquals(TransactionId.SENTINEL, actualVer.getStripeId());
assertEquals(false, actualVer.isHistorical());
@@ -263,7 +264,7 @@ public class DataFactoryImplTest {
VersionData actualVer = actual.getVersion();
assertEquals(COMMON, actualVer.getBranch());
- assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
+ assertEquals(GammaId.SENTINEL, actualVer.getGammaId());
assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
assertEquals(TransactionId.SENTINEL, actualVer.getStripeId());
assertEquals(false, actualVer.isHistorical());
@@ -287,7 +288,7 @@ public class DataFactoryImplTest {
VersionData actualVer = actual.getVersion();
assertNotSame(verData, actualVer);
assertEquals(COMMON, actualVer.getBranch());
- assertEquals(222L, actualVer.getGammaId());
+ assertEquals(gamma222, actualVer.getGammaId());
assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
assertEquals(artData.getVersion().getStripeId(), actualVer.getStripeId());
assertEquals(false, actualVer.isHistorical());
@@ -308,7 +309,7 @@ public class DataFactoryImplTest {
VersionData actualVer = actual.getVersion();
assertNotSame(verData, actualVer);
assertEquals(COMMON, actualVer.getBranch());
- assertEquals(222L, actualVer.getGammaId());
+ assertEquals(gamma222, actualVer.getGammaId());
assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
assertEquals(attrData.getVersion().getStripeId(), actualVer.getStripeId());
assertEquals(false, actualVer.isHistorical());
@@ -342,7 +343,7 @@ public class DataFactoryImplTest {
VersionData actualVer = actual.getVersion();
assertNotSame(verData, actualVer);
assertEquals(COMMON, actualVer.getBranch());
- assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
+ assertEquals(GammaId.SENTINEL, actualVer.getGammaId());
assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
assertEquals(TransactionId.SENTINEL, actualVer.getStripeId());
assertEquals(false, actualVer.isHistorical());
@@ -363,7 +364,7 @@ public class DataFactoryImplTest {
VersionData actualVer = actual.getVersion();
assertNotSame(verData, actualVer);
assertEquals(COMMON, actualVer.getBranch());
- assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
+ assertEquals(GammaId.SENTINEL, actualVer.getGammaId());
assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
assertEquals(TransactionId.SENTINEL, actualVer.getStripeId());
assertEquals(false, actualVer.isHistorical());
@@ -394,7 +395,7 @@ public class DataFactoryImplTest {
assertNotSame(verData, actualVer);
assertEquals(BRANCH, actualVer.getBranch());
- assertEquals(222L, actualVer.getGammaId());
+ assertEquals(gamma222, actualVer.getGammaId());
assertEquals(tx333, actualVer.getTransactionId());
assertEquals(tx444, actualVer.getStripeId());
assertEquals(true, actualVer.isHistorical());
@@ -419,7 +420,7 @@ public class DataFactoryImplTest {
assertNotSame(verData, actualVer);
assertEquals(BRANCH, actualVer.getBranch());
- assertEquals(222L, actualVer.getGammaId());
+ assertEquals(gamma222, actualVer.getGammaId());
assertEquals(tx333, actualVer.getTransactionId());
assertEquals(tx444, actualVer.getStripeId());
assertEquals(true, actualVer.isHistorical());
@@ -450,7 +451,7 @@ public class DataFactoryImplTest {
assertNotSame(verData, actualVer);
assertEquals(BRANCH, actualVer.getBranch());
- assertEquals(222L, actualVer.getGammaId());
+ assertEquals(gamma222, actualVer.getGammaId());
assertEquals(tx333, actualVer.getTransactionId());
assertEquals(tx444, actualVer.getStripeId());
assertEquals(true, actualVer.isHistorical());
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/DaoToSqlTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/DaoToSqlTest.java
index 2657c1ecee..cb61b646d4 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/DaoToSqlTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/DaoToSqlTest.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.transaction;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.orcs.core.ds.DataProxy;
import org.junit.Assert;
@@ -21,10 +22,11 @@ import org.mockito.MockitoAnnotations;
/**
* Test Case for {@link DaoToSql}
- *
+ *
* @author Roberto E. Escobar
*/
public class DaoToSqlTest {
+ private static final GammaId gamma123 = GammaId.valueOf(123);
@Mock
private DataProxy proxy;
@@ -37,14 +39,14 @@ public class DaoToSqlTest {
@Test
public void testGetGammaIdAndIsNewGammaId() {
boolean isNewGammaId = true;
- long gammaId = 2345L;
+ GammaId gammaId = GammaId.valueOf(2345);
DaoToSql dao1 = new DaoToSql(gammaId, proxy, isNewGammaId);
Assert.assertEquals(gammaId, dao1.getGammaId());
Assert.assertEquals(true, dao1.hasNewGammaId());
- DaoToSql dao2 = new DaoToSql(1234L, proxy, false);
- Assert.assertEquals(1234L, dao2.getGammaId());
+ DaoToSql dao2 = new DaoToSql(gamma123, proxy, false);
+ Assert.assertEquals(gamma123, dao2.getGammaId());
Assert.assertEquals(false, dao2.hasNewGammaId());
}
@@ -56,7 +58,7 @@ public class DaoToSqlTest {
Mockito.when(proxy.getData()).thenReturn(data);
- DaoToSql dao = new DaoToSql(1234L, proxy, false);
+ DaoToSql dao = new DaoToSql(gamma123, proxy, false);
Assert.assertEquals(uri, dao.getUri());
Assert.assertEquals(value, dao.getValue());
}
@@ -69,7 +71,7 @@ public class DaoToSqlTest {
Mockito.when(proxy.getData()).thenReturn(data);
- DaoToSql dao = new DaoToSql(1234L, proxy, false);
+ DaoToSql dao = new DaoToSql(gamma123, proxy, false);
Assert.assertEquals("", dao.getUri());
Assert.assertEquals(value, dao.getValue());
}
@@ -82,37 +84,34 @@ public class DaoToSqlTest {
Mockito.when(proxy.getData()).thenReturn(data);
- DaoToSql dao = new DaoToSql(1234L, proxy, false);
+ DaoToSql dao = new DaoToSql(gamma123, proxy, false);
Assert.assertEquals("", dao.getUri());
Assert.assertEquals(value, dao.getValue());
}
@Test
public void testPersist() throws OseeCoreException {
- long gammaId = 2345L;
- DaoToSql dao = new DaoToSql(gammaId, proxy, true);
+ DaoToSql dao = new DaoToSql(gamma123, proxy, true);
dao.persist();
- Mockito.verify(proxy).persist(gammaId);
+ Mockito.verify(proxy).persist(gamma123.getId());
Mockito.reset(proxy);
- DaoToSql dao2 = new DaoToSql(gammaId, proxy, false);
+ DaoToSql dao2 = new DaoToSql(gamma123, proxy, false);
dao2.persist();
- Mockito.verify(proxy, Mockito.times(0)).persist(gammaId);
+ Mockito.verify(proxy, Mockito.times(0)).persist(gamma123.getId());
}
@Test
public void testPurge() throws OseeCoreException {
- long gammaId = 2345L;
- DaoToSql dao = new DaoToSql(gammaId, proxy, true);
+ DaoToSql dao = new DaoToSql(gamma123, proxy, true);
dao.rollBack();
Mockito.verify(proxy).purge();
Mockito.reset(proxy);
- DaoToSql dao2 = new DaoToSql(gammaId, proxy, false);
+ DaoToSql dao2 = new DaoToSql(gamma123, proxy, false);
dao2.rollBack();
Mockito.verify(proxy, Mockito.times(0)).purge();
}
-
-}
+} \ 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 a41abc9b2e..75ff8db9ff 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,7 +30,7 @@ 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.RelationalConstants;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
@@ -84,7 +84,7 @@ public class TxSqlBuilderTest {
private static final String EXP_GUID = GUID.create();
private static final long TYPE_UUID = 72132144189L;
- private static final long NEXT_GAMMA_ID = 751382L;
+ private static final GammaId NEXT_GAMMA_ID = GammaId.valueOf(751382);
private static final ArtifactId A_ART_ID = ArtifactId.valueOf(6737);
private static final ArtifactId B_ART_ID = ArtifactId.valueOf(1231);
@@ -148,7 +148,7 @@ public class TxSqlBuilderTest {
tx.setDate(EXPECTED_TX_TIME);
tx.setTxType(EXPECTED_TX_TYPE);
- when(idManager.getNextGammaId()).thenReturn(NEXT_GAMMA_ID);
+ when(idManager.getNextGammaId()).thenReturn(NEXT_GAMMA_ID.getId());
}
@Test
@@ -215,7 +215,7 @@ public class TxSqlBuilderTest {
ModificationType expectedType = modType != REPLACED_WITH_VERSION ? modType : MODIFIED;
// @formatter:off
- verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, -1L, expectedType.getValue(), TxChange.getCurrent(expectedType).getValue(), COMMON);
+ verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, GammaId.SENTINEL, expectedType.getValue(), TxChange.getCurrent(expectedType).getValue(), COMMON);
verifyQuery(SqlOrderEnum.ARTIFACTS);
// @formatter:on
@@ -285,7 +285,7 @@ public class TxSqlBuilderTest {
ModificationType expectedType = modType != REPLACED_WITH_VERSION ? modType : MODIFIED;
// @formatter:off
- verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, -1L, expectedType.getValue(), TxChange.getCurrent(expectedType).getValue(), COMMON);
+ verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, GammaId.SENTINEL, expectedType.getValue(), TxChange.getCurrent(expectedType).getValue(), COMMON);
verifyQuery(SqlOrderEnum.RELATIONS);
// @formatter:on
@@ -341,7 +341,7 @@ public class TxSqlBuilderTest {
ModificationType expectedType = modType != REPLACED_WITH_VERSION ? modType : MODIFIED;
// @formatter:off
- verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, -1L, expectedType.getValue(), TxChange.getCurrent(expectedType).getValue(), COMMON);
+ verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, GammaId.SENTINEL, expectedType.getValue(), TxChange.getCurrent(expectedType).getValue(), COMMON);
verifyQuery(SqlOrderEnum.ATTRIBUTES);
// @formatter:on
@@ -351,7 +351,7 @@ public class TxSqlBuilderTest {
private void reset(OrcsData data) {
data.getVersion().setTransactionId(LOADED_TX_ID);
- data.getVersion().setGammaId(RelationalConstants.GAMMA_SENTINEL);
+ data.getVersion().setGammaId(GammaId.SENTINEL.getId());
}
private void verifyQuery(SqlOrderEnum key) {
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 160ffc3199..c497ae9491 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
@@ -25,7 +25,6 @@ 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.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;
@@ -223,16 +222,16 @@ public class MissingChangeItemFactoryImpl implements MissingChangeItemFactory {
private ChangeItem createArtifactChangeItem(ArtifactData data) throws OseeCoreException {
ApplicabilityId appId = data.getApplicabilityId();
ChangeItem artChange = ChangeItemUtil.newArtifactChange(ArtifactId.valueOf(data.getLocalId()),
- ArtifactTypeId.valueOf(data.getTypeUuid()), GammaId.valueOf(data.getVersion().getGammaId()),
- determineModType(data), getApplicabilityToken(appId));
+ ArtifactTypeId.valueOf(data.getTypeUuid()), data.getVersion().getGammaId(), determineModType(data),
+ getApplicabilityToken(appId));
return artChange;
}
private ChangeItem createAttributeChangeItem(AttributeData data) throws OseeCoreException {
ApplicabilityId appId = data.getApplicabilityId();
ChangeItem attrChange = ChangeItemUtil.newAttributeChange(data, AttributeTypeId.valueOf(data.getTypeUuid()),
- ArtifactId.valueOf(data.getArtifactId()), GammaId.valueOf(data.getVersion().getGammaId()),
- determineModType(data), data.getDataProxy().getDisplayableString(), getApplicabilityToken(appId));
+ ArtifactId.valueOf(data.getArtifactId()), data.getVersion().getGammaId(), determineModType(data),
+ data.getDataProxy().getDisplayableString(), getApplicabilityToken(appId));
attrChange.getNetChange().copy(attrChange.getCurrentVersion());
return attrChange;
}
@@ -240,9 +239,8 @@ public class MissingChangeItemFactoryImpl implements MissingChangeItemFactory {
private ChangeItem createRelationChangeItem(RelationData data) throws OseeCoreException {
ApplicabilityId appId = data.getApplicabilityId();
return ChangeItemUtil.newRelationChange(RelationId.valueOf(Long.valueOf(data.getLocalId())),
- RelationTypeId.valueOf(data.getTypeUuid()), GammaId.valueOf(data.getVersion().getGammaId()),
- determineModType(data), data.getArtifactIdA(), data.getArtifactIdB(), data.getRationale(),
- getApplicabilityToken(appId));
+ RelationTypeId.valueOf(data.getTypeUuid()), data.getVersion().getGammaId(), determineModType(data),
+ data.getArtifactIdA(), data.getArtifactIdB(), data.getRationale(), getApplicabilityToken(appId));
}
}
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 d10bc58206..048eb5e36c 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
@@ -14,6 +14,7 @@ import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.RelationTypeId;
import org.eclipse.osee.framework.core.data.RelationalConstants;
@@ -176,7 +177,7 @@ public class DataFactoryImpl implements DataFactory {
version.setTransactionId(TransactionId.SENTINEL);
version.setStripeId(TransactionId.SENTINEL);
version.setHistorical(false);
- version.setGammaId(RelationalConstants.GAMMA_SENTINEL);
+ version.setGammaId(GammaId.SENTINEL.getId());
data.setModType(ModificationType.NEW);
}
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 b96fca0e74..d4a2f24bd4 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
@@ -15,6 +15,7 @@ import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.RelationTypeId;
import org.eclipse.osee.framework.core.data.RelationalConstants;
@@ -51,7 +52,7 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
}
@Override
- public VersionData createVersion(BranchId branchId, TransactionId txId, long gamma, boolean historical) {
+ public VersionData createVersion(BranchId branchId, TransactionId txId, GammaId gamma, boolean historical) {
return createVersion(branchId, txId, gamma, historical, TransactionId.SENTINEL);
}
@@ -61,7 +62,7 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
return createVersion(
BranchId.SENTINEL,
TransactionId.SENTINEL,
- RelationalConstants.GAMMA_SENTINEL,
+ GammaId.SENTINEL,
RelationalConstants.IS_HISTORICAL_DEFAULT,
TransactionId.SENTINEL);
// @formatter:on
@@ -79,11 +80,11 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
// @formatter:on
}
- private VersionData createVersion(BranchId branchId, TransactionId txId, long gamma, boolean historical, TransactionId stripeId) {
+ private VersionData createVersion(BranchId branchId, TransactionId txId, GammaId gamma, boolean historical, TransactionId stripeId) {
VersionData version = new VersionDataImpl();
version.setBranch(branchId);
version.setTransactionId(txId);
- version.setGammaId(gamma);
+ version.setGammaId(gamma.getId());
version.setHistorical(historical);
version.setStripeId(stripeId);
return version;
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/VersionDataImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/VersionDataImpl.java
index a223c16a3a..fad69b453f 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/VersionDataImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/VersionDataImpl.java
@@ -10,9 +10,9 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.loader.data;
-import static org.eclipse.osee.framework.core.data.RelationalConstants.GAMMA_SENTINEL;
import static org.eclipse.osee.framework.core.data.RelationalConstants.IS_HISTORICAL_DEFAULT;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.orcs.core.ds.VersionData;
@@ -23,7 +23,7 @@ public class VersionDataImpl implements VersionData {
private BranchId branch = BranchId.SENTINEL;
private TransactionId txId = TransactionId.SENTINEL;
- private long gamma = GAMMA_SENTINEL;
+ private GammaId gamma = GammaId.SENTINEL;
private boolean historical = IS_HISTORICAL_DEFAULT;
private TransactionId stripeId = TransactionId.SENTINEL;
@@ -32,13 +32,13 @@ public class VersionDataImpl implements VersionData {
}
@Override
- public long getGammaId() {
+ public GammaId getGammaId() {
return gamma;
}
@Override
public void setGammaId(long gamma) {
- this.gamma = gamma;
+ this.gamma = GammaId.valueOf(gamma);
}
@Override
@@ -91,7 +91,7 @@ public class VersionDataImpl implements VersionData {
final int prime = 31;
int result = 1;
result = prime * result + branch.hashCode();
- result = prime * result + (int) (gamma ^ gamma >>> 32);
+ result = prime * result + gamma.hashCode();
result = prime * result + (historical ? 1231 : 1237);
result = prime * result + stripeId.hashCode();
result = prime * result + txId.hashCode();
@@ -137,7 +137,7 @@ public class VersionDataImpl implements VersionData {
public VersionData clone() {
VersionData copy = new VersionDataImpl();
copy.setBranch(getBranch());
- copy.setGammaId(getGammaId());
+ copy.setGammaId(getGammaId().getId());
copy.setHistorical(isHistorical());
copy.setStripeId(getStripeId());
copy.setTransactionId(getTransactionId());
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/VersionObjectFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/VersionObjectFactory.java
index b4b05d5442..eb07839f72 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/VersionObjectFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/VersionObjectFactory.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.orcs.db.internal.loader.data;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.orcs.core.ds.VersionData;
@@ -22,7 +23,7 @@ public interface VersionObjectFactory extends OrcsDataFactory {
VersionData createDefaultVersionData();
- VersionData createVersion(BranchId branch, TransactionId txId, long gamma, boolean historical) throws OseeCoreException;
+ VersionData createVersion(BranchId branch, TransactionId txId, GammaId gamma, boolean historical) throws OseeCoreException;
VersionData createCopy(VersionData other) throws OseeCoreException;
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/ArtifactLoadProcessor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/ArtifactLoadProcessor.java
index e8cb9dbf35..6a6c677a84 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/ArtifactLoadProcessor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/ArtifactLoadProcessor.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.orcs.db.internal.loader.processor;
import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -46,7 +47,7 @@ public class ArtifactLoadProcessor extends LoadProcessor<ArtifactData, ArtifactO
// assumption: SQL is returning unwanted deleted artifacts only in the historical case
boolean historical = OptionsUtil.isHistorical(options);
if (!historical || OptionsUtil.areDeletedArtifactsIncluded(options) || modType != ModificationType.DELETED) {
- long gamma = chStmt.getInt("gamma_id");
+ GammaId gamma = GammaId.valueOf(chStmt.getLong("gamma_id"));
TransactionId txId = TransactionId.valueOf(chStmt.getLong("transaction_id"));
VersionData version = factory.createVersion(branch, txId, gamma, historical);
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 76164a63ae..619f4fa919 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
@@ -13,6 +13,7 @@ package org.eclipse.osee.orcs.db.internal.loader.processor;
import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -47,7 +48,7 @@ public class AttributeLoadProcessor extends LoadProcessor<AttributeData, Attribu
BranchId branch = BranchId.create(chStmt.getLong("branch_id"), OptionsUtil.getFromBranchView(options));
int artId = chStmt.getInt("id2");
int attrId = chStmt.getInt("attr_id");
- long gammaId = chStmt.getInt("gamma_id");
+ GammaId gammaId = GammaId.valueOf(chStmt.getLong("gamma_id"));
ModificationType modType = ModificationType.getMod(chStmt.getInt("mod_type"));
ApplicabilityId applicId = ApplicabilityId.valueOf(chStmt.getLong("app_id"));
@@ -112,14 +113,14 @@ public class AttributeLoadProcessor extends LoadProcessor<AttributeData, Attribu
int previousArtId = -1;
BranchId previousBranchId = BranchId.SENTINEL;
int previousAttrId = -1;
- long previousGammaId = -1;
+ GammaId previousGammaId = GammaId.SENTINEL;
ModificationType previousModType = null;
boolean isSame(BranchId branch, int artifactId, int attrId) {
return previousBranchId.equals(branch) && previousArtId == artifactId && previousAttrId == attrId;
}
- void saveConditions(BranchId branch, int artifactId, int attrId, long gammaId, ModificationType modType) {
+ void saveConditions(BranchId branch, int artifactId, int attrId, GammaId gammaId, ModificationType modType) {
previousBranchId = branch;
previousArtId = artifactId;
previousAttrId = attrId;
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/RelationLoadProcessor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/RelationLoadProcessor.java
index d84a105a03..caf1bad765 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/RelationLoadProcessor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/RelationLoadProcessor.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.orcs.db.internal.loader.processor;
import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.data.RelationTypeId;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.enums.ModificationType;
@@ -45,7 +46,7 @@ public class RelationLoadProcessor extends LoadProcessor<RelationData, RelationO
ArtifactId aArtId = ArtifactId.valueOf(chStmt.getLong("a_art_id"));
ArtifactId bArtId = ArtifactId.valueOf(chStmt.getLong("b_art_id"));
RelationTypeId relationType = RelationTypeId.valueOf(chStmt.getLong("rel_link_type_id"));
- long gammaId = chStmt.getInt("gamma_id");
+ GammaId gammaId = GammaId.valueOf(chStmt.getInt("gamma_id"));
ApplicabilityId applicId = ApplicabilityId.valueOf(chStmt.getLong("app_id"));
boolean historical = OptionsUtil.isHistorical(options);
@@ -97,14 +98,14 @@ public class RelationLoadProcessor extends LoadProcessor<RelationData, RelationO
ArtifactId previousArtIdA = ArtifactId.SENTINEL;
ArtifactId previousArtIdB = ArtifactId.SENTINEL;
RelationTypeId previousTypeId = RelationTypeId.SENTINEL;
- long previousGammaId = -1;
+ GammaId previousGammaId = GammaId.SENTINEL;
boolean isSame(BranchId branch, ArtifactId aArtId, ArtifactId bArtId, RelationTypeId typeId) {
return previousBranchId.equals(branch) && previousArtIdA.equals(aArtId) && previousArtIdB.equals(
bArtId) && previousTypeId.equals(typeId);
}
- void saveConditions(BranchId branch, ArtifactId aArtId, ArtifactId bArtId, RelationTypeId typeId, long gammaId) {
+ void saveConditions(BranchId branch, ArtifactId aArtId, ArtifactId bArtId, RelationTypeId typeId, GammaId gammaId) {
previousBranchId = branch;
previousArtIdA = aArtId;
previousArtIdB = bArtId;
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 579d4d7014..18fd421b0b 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
@@ -139,7 +139,7 @@ public class AttributeDataMatcher {
@Override
public long getGammaId() {
- return attrData.getVersion().getGammaId();
+ return attrData.getVersion().getGammaId().getId();
}
@Override
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/DaoToSql.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/DaoToSql.java
index 2a9fcf2cc4..f45624b72b 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/DaoToSql.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/DaoToSql.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.transaction;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.orcs.core.ds.DataProxy;
@@ -17,11 +18,11 @@ import org.eclipse.osee.orcs.core.ds.DataProxy;
* @author Roberto E. Escobar
*/
public class DaoToSql {
- private final long gammaId;
+ private final GammaId gammaId;
private final DataProxy proxy;
private final boolean isNewGammaId;
- public DaoToSql(long gammaId, DataProxy proxy, boolean isNewGammaId) {
+ public DaoToSql(GammaId gammaId, DataProxy proxy, boolean isNewGammaId) {
super();
this.gammaId = gammaId;
this.proxy = proxy;
@@ -32,7 +33,7 @@ public class DaoToSql {
return isNewGammaId;
}
- public long getGammaId() {
+ public GammaId getGammaId() {
return gammaId;
}
@@ -52,7 +53,7 @@ public class DaoToSql {
public void persist() throws OseeCoreException {
if (isNewGammaId) {
- proxy.persist(gammaId);
+ proxy.persist(gammaId.getId());
}
}
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 0298bc0e1f..9bc52f4713 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
@@ -49,7 +49,7 @@ public class TransactionIndexer implements TransactionProcessor {
public void visit(AttributeData data) {
AttributeTypeId type = types.get(data.getTypeUuid());
if (types.isTaggable(type)) {
- datas.add(data.getVersion().getGammaId());
+ datas.add(data.getVersion().getGammaId().getId());
}
}
});

Back to the top