Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2016-11-04 11:48:18 -0400
committerDavid W. Miller2016-11-04 11:48:18 -0400
commit21c5012afe30c442dab8f0f5f94aa46dd34ae5d4 (patch)
tree564a5f63b8600ce7841ec08962162058cc0ebd88
parenta3ed93759e71e633865896b8f1301c0bff0fe4f0 (diff)
downloadorg.eclipse.osee-21c5012afe30c442dab8f0f5f94aa46dd34ae5d4.tar.gz
org.eclipse.osee-21c5012afe30c442dab8f0f5f94aa46dd34ae5d4.tar.xz
org.eclipse.osee-21c5012afe30c442dab8f0f5f94aa46dd34ae5d4.zip
refactor: Remove HasLocalId from ArtifactReadable
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsBranchServiceImpl.java22
-rw-r--r--plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/DataRightsSwReqAndCodeResource.java5
-rw-r--r--plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/TraceInformationAccumulator.java6
-rw-r--r--plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/SubscriptionUtil.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/JdbcJaxRsOAuthStorage.java10
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImplTest.java10
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAssociatedArtId.java10
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchCriteriaFactory.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchQueryBuilderImpl.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsRelationLoadingTest.java13
-rw-r--r--plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTransactionTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java3
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/BranchQueryBuilder.java3
16 files changed, 39 insertions, 72 deletions
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsBranchServiceImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsBranchServiceImpl.java
index f259536127..504be5d5a9 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsBranchServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsBranchServiceImpl.java
@@ -30,7 +30,6 @@ import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.jdk.core.type.HashCollection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.orcs.OrcsApi;
-import org.eclipse.osee.orcs.data.ArtifactReadable;
import org.eclipse.osee.orcs.data.BranchReadable;
import org.eclipse.osee.orcs.search.BranchQuery;
import org.eclipse.osee.orcs.search.TransactionQuery;
@@ -53,12 +52,10 @@ public class AtsBranchServiceImpl extends AbstractAtsBranchService {
@Override
public IOseeBranch getCommittedWorkingBranch(IAtsTeamWorkflow teamWf) {
- int assocArtId = ((ArtifactReadable) teamWf.getStoreObject()).getLocalId();
BranchQuery query = orcsApi.getQueryFactory().branchQuery();
- query =
- query.andIsOfType(BranchType.WORKING).andStateIs(BranchState.COMMITTED).excludeArchived().andAssociatedArtId(
- assocArtId);
- return query.getResults().getOneOrNull();
+ ArtifactId artId = ArtifactId.valueOf(teamWf.getId());
+ return query.andIsOfType(BranchType.WORKING).andStateIs(
+ BranchState.COMMITTED).excludeArchived().andAssociatedArtId(artId).getResults().getOneOrNull();
}
@Override
@@ -70,7 +67,8 @@ public class AtsBranchServiceImpl extends AbstractAtsBranchService {
branchQuery.andStateIs(statesToSearch.toArray(new BranchState[statesToSearch.size()]));
}
branchQuery.andIsOfType(BranchType.WORKING);
- branchQuery.andAssociatedArtId(((ArtifactReadable) teamWf.getStoreObject()).getLocalId());
+ ArtifactId artId = ArtifactId.valueOf(teamWf.getId());
+ branchQuery.andAssociatedArtId(artId);
return branchQuery.getResultsAsId().getOneOrNull();
}
@@ -130,14 +128,14 @@ public class AtsBranchServiceImpl extends AbstractAtsBranchService {
@Override
public Collection<TransactionRecord> getCommittedArtifactTransactionIds(IAtsTeamWorkflow teamWf) {
- ArtifactId artifact = teamWf.getStoreObject();
- if (!commitArtifactIdMap.containsKey(artifact)) {
- txQuery.andCommitIds(artifact.getId().intValue());
+ ArtifactId artId = ArtifactId.valueOf(teamWf.getId());
+ if (!commitArtifactIdMap.containsKey(artId)) {
+ txQuery.andCommitIds(teamWf.getId().intValue());
txQuery.getResults().forEach(
- tx -> commitArtifactIdMap.put(artifact, new TransactionRecord(tx.getId(), tx.getBranch(), tx.getComment(),
+ tx -> commitArtifactIdMap.put(artId, new TransactionRecord(tx.getId(), tx.getBranch(), tx.getComment(),
tx.getDate(), tx.getAuthor().getId().intValue(), tx.getCommitArt().getId().intValue(), tx.getTxType())));
}
- Collection<TransactionRecord> transactions = commitArtifactIdMap.getValues(artifact);
+ Collection<TransactionRecord> transactions = commitArtifactIdMap.getValues(artId);
return transactions == null ? Collections.emptyList() : transactions;
}
diff --git a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/DataRightsSwReqAndCodeResource.java b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/DataRightsSwReqAndCodeResource.java
index 9846e75969..5313c94c3f 100644
--- a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/DataRightsSwReqAndCodeResource.java
+++ b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/DataRightsSwReqAndCodeResource.java
@@ -186,8 +186,7 @@ public final class DataRightsSwReqAndCodeResource {
continue;
}
- ArtifactReadable source =
- queryFactory.fromBranch(sourceBranch).andUuid(dest.getLocalId()).getResults().getAtMostOneOrNull();
+ ArtifactReadable source = queryFactory.fromBranch(sourceBranch).andId(dest).getResults().getAtMostOneOrNull();
if (source == null) {
String classification = dest.getSoleAttributeValue(CoreAttributeTypes.DataRightsClassification, "");
String subsystem = dest.getSoleAttributeValue(CoreAttributeTypes.Subsystem, "");
@@ -211,7 +210,7 @@ public final class DataRightsSwReqAndCodeResource {
private void appendDetails(String msg, StringBuilder strb, ArtifactReadable art, String subsystem, String classification) {
strb.append(
- msg + "|" + subsystem + "|" + classification + " |" + art.getArtifactType() + "| " + art.getName() + "| " + art.getLocalId() + "| " + art.getLastModifiedTransaction() + "<br />");
+ msg + "|" + subsystem + "|" + classification + " |" + art.getArtifactType() + "| " + art.getName() + "| " + art.getId() + "| " + art.getLastModifiedTransaction() + "<br />");
}
private TransactionBuilder createTxBuilder(String comment, BranchId branchId) {
diff --git a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/TraceInformationAccumulator.java b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/TraceInformationAccumulator.java
index c6f45118a3..7295f2ba67 100644
--- a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/TraceInformationAccumulator.java
+++ b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/TraceInformationAccumulator.java
@@ -83,7 +83,7 @@ public class TraceInformationAccumulator {
int count = 0;
for (ArtifactReadable ar : items) {
traceWriter.writeCell(ar.getName(), TraceReportGenerator.SOFTWARE_SHEETREQ_INDEX);
- traceWriter.writeCell(ar.getLocalId());
+ traceWriter.writeCell(ar.getId());
traceWriter.endRow();
count++;
}
@@ -93,7 +93,7 @@ public class TraceInformationAccumulator {
private void processSoftwareRequirement(ArtifactReadable softwareRequirement) throws IOException {
traceWriter.writeCell(handleEquivalentName(softwareRequirement), TraceReportGenerator.SOFTWARE_REQUIREMENT_INDEX);
- traceWriter.writeCell(softwareRequirement.getLocalId());
+ traceWriter.writeCell(softwareRequirement.getId());
traceWriter.writeCell(softwareRequirement.getSoleAttributeAsString(CoreAttributeTypes.SeverityCategory, "none"));
@@ -148,7 +148,7 @@ public class TraceInformationAccumulator {
if (items.size() > 0) {
for (ArtifactReadable ar : items) {
traceWriter.writeCell(ar.getName(), location);
- traceWriter.writeCell(ar.getLocalId());
+ traceWriter.writeCell(ar.getId());
traceWriter.endRow();
}
}
diff --git a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java
index 316ab15e68..1768cc83ad 100644
--- a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java
+++ b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java
@@ -110,7 +110,7 @@ public class WordUpdateArtifact {
for (WordExtractorData extractorData : extractorDatas) {
ArtifactReadable artifact = getArtifact(data.getBranch(), extractorData.getGuid());
WordArtifactChange artChange = new WordArtifactChange();
- artChange.setArtId(artifact.getLocalId());
+ artChange.setArtId(artifact.getId());
if (artifact.isDeleted()) {
deletedArtifacts.add(artifact.getName());
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/SubscriptionUtil.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/SubscriptionUtil.java
index 7359671677..c7a2fa7f4c 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/SubscriptionUtil.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/SubscriptionUtil.java
@@ -55,13 +55,10 @@ public final class SubscriptionUtil {
}
public static Subscription fromArtifactData(ArtifactReadable account, ArtifactReadable subscription, boolean isActive) {
- int accountId = account.getLocalId();
- ArtifactId artId = ArtifactId.valueOf(accountId);
String accountName = account.getName();
- int groupId = subscription.getLocalId();
- SubscriptionGroupId subcriptionId = new SubscriptionGroupId((long) groupId);
+ SubscriptionGroupId subcriptionId = new SubscriptionGroupId(subscription.getId());
String subscriptionName = subscription.getName();
- return fromData(artId, accountName, subcriptionId, subscriptionName, isActive);
+ return fromData(account, accountName, subcriptionId, subscriptionName, isActive);
}
private static final class DelegatingActiveSubscriptionImpl extends SubscriptionImpl {
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/JdbcJaxRsOAuthStorage.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/JdbcJaxRsOAuthStorage.java
index 91251db447..a32c6d1169 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/JdbcJaxRsOAuthStorage.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/JdbcJaxRsOAuthStorage.java
@@ -122,7 +122,7 @@ public class JdbcJaxRsOAuthStorage implements JaxRsOAuthStorage {
long clientId = clientArtId.getUuid();
ArtifactReadable artifact = clientStorage.getClientByClientUuid(clientId).getExactlyOne();
- long applicationId = artifact.getLocalId();
+ Long applicationId = artifact.getId();
OAuthClientCredential credential = asCredential(clientId, client, applicationId);
if (credentialStorage.getByClientIdAndApplicationId(clientId, applicationId) != null) {
@@ -164,9 +164,7 @@ public class JdbcJaxRsOAuthStorage implements JaxRsOAuthStorage {
ClientStorage clientStorage = getClientStorage();
ArtifactReadable artifact = clientStorage.getClientByClientGuid(guid).getOneOrNull();
if (artifact != null) {
- Integer applicationId = artifact.getLocalId();
-
- OAuthClientCredential credential = credentialStorage.getByApplicationId(applicationId);
+ OAuthClientCredential credential = credentialStorage.getByApplicationId(artifact.getId());
client = clientStorage.newClient(artifact, credential);
}
return client;
@@ -178,9 +176,7 @@ public class JdbcJaxRsOAuthStorage implements JaxRsOAuthStorage {
ClientStorage clientStorage = getClientStorage();
ArtifactReadable artifact = clientStorage.getClientByClientUuid(uuid).getOneOrNull();
if (artifact != null) {
- Integer applicationId = artifact.getLocalId();
-
- OAuthClientCredential credential = credentialStorage.getByApplicationId(applicationId);
+ OAuthClientCredential credential = credentialStorage.getByApplicationId(artifact.getId());
client = clientStorage.newClient(artifact, credential);
}
return client;
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImplTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImplTest.java
index 296f94ad92..b12cefa296 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImplTest.java
@@ -131,16 +131,6 @@ public class ArtifactReadOnlyImplTest {
}
@Test
- public void testGetLocalId() {
- when(proxiedObject.getLocalId()).thenReturn(45);
-
- int actual = readOnly.getLocalId();
-
- assertEquals(45, actual);
- verify(proxiedObject).getLocalId();
- }
-
- @Test
public void testGetName() {
String name = "This is my name";
when(proxiedObject.getName()).thenReturn(name);
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAssociatedArtId.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAssociatedArtId.java
index deb1978279..883571ee19 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAssociatedArtId.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAssociatedArtId.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.ds.criteria;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
import org.eclipse.osee.orcs.core.ds.Criteria;
@@ -20,20 +21,19 @@ import org.eclipse.osee.orcs.core.ds.Options;
*/
public class CriteriaAssociatedArtId extends Criteria implements BranchCriteria {
- private final Integer associatedArtId;
+ private final ArtifactId associatedArtId;
- public CriteriaAssociatedArtId(Integer associatedArtId) {
- super();
+ public CriteriaAssociatedArtId(ArtifactId associatedArtId) {
this.associatedArtId = associatedArtId;
}
- public Integer getAssociatedArtId() {
+ public ArtifactId getAssociatedArtId() {
return associatedArtId;
}
@Override
public void checkValid(Options options) throws OseeCoreException {
- Conditions.checkExpressionFailOnTrue(associatedArtId == null, "Associated artifact id cannot be null");
+ Conditions.checkExpressionFailOnTrue(associatedArtId.isInvalid(), "Associated artifact id cannot be null");
}
@Override
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java
index b6507738a9..ec3af99129 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java
@@ -76,11 +76,6 @@ public class ArtifactReadOnlyImpl extends AbstractProxied<Artifact> implements A
}
@Override
- public Integer getLocalId() {
- return getProxiedObject().getLocalId();
- }
-
- @Override
public BranchId getBranch() {
return getProxiedObject().getBranch();
}
@@ -311,7 +306,7 @@ public class ArtifactReadOnlyImpl extends AbstractProxied<Artifact> implements A
@Override
public Long getId() {
- return Long.valueOf(getLocalId());
+ return getProxiedObject().getLocalId().longValue();
}
@Override
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchCriteriaFactory.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchCriteriaFactory.java
index 6da1ea96bc..f8404439d9 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchCriteriaFactory.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchCriteriaFactory.java
@@ -1,6 +1,7 @@
package org.eclipse.osee.orcs.core.internal.search;
import java.util.Collection;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.BranchArchivedState;
import org.eclipse.osee.framework.core.enums.BranchState;
@@ -58,7 +59,7 @@ public class BranchCriteriaFactory {
return new CriteriaMergeBranchFor(source, destination);
}
- public Criteria createAssociatedArtIdCriteria(int artId) {
+ public Criteria createAssociatedArtIdCriteria(ArtifactId artId) {
return new CriteriaAssociatedArtId(artId);
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchQueryBuilderImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchQueryBuilderImpl.java
index 079ab3928e..bf4f052af4 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchQueryBuilderImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchQueryBuilderImpl.java
@@ -20,6 +20,7 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.BranchArchivedState;
import org.eclipse.osee.framework.core.enums.BranchState;
@@ -171,7 +172,7 @@ public class BranchQueryBuilderImpl<T> implements BranchQueryBuilder<T> {
}
@Override
- public T andAssociatedArtId(int artId) {
+ public T andAssociatedArtId(ArtifactId artId) {
Criteria criteria = criteriaFactory.createAssociatedArtIdCriteria(artId);
return addAndCheck(getQueryData(), criteria);
}
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java
index 3d560f312b..aacf11eb28 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java
@@ -16,6 +16,7 @@ import static org.eclipse.osee.framework.core.enums.BranchState.CREATED;
import static org.eclipse.osee.framework.core.enums.BranchState.CREATION_IN_PROGRESS;
import static org.eclipse.osee.framework.core.enums.BranchType.SYSTEM_ROOT;
import static org.eclipse.osee.framework.core.enums.BranchType.WORKING;
+import static org.eclipse.osee.framework.core.enums.CoreArtifactTokens.DefaultHierarchyRoot;
import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;
@@ -459,7 +460,7 @@ public class BranchQuerySqlContextFactoryImplTest {
"br1.associated_art_id = ?\n" + //
" ORDER BY br1.branch_id";
- queryData.addCriteria(new CriteriaAssociatedArtId(4));
+ queryData.addCriteria(new CriteriaAssociatedArtId(DefaultHierarchyRoot));
QuerySqlContext context = queryEngine.createQueryContext(session, queryData);
@@ -471,7 +472,7 @@ public class BranchQuerySqlContextFactoryImplTest {
assertEquals(0, joins.size());
Iterator<Object> iterator = parameters.iterator();
- assertEquals(4, iterator.next());
+ assertEquals(DefaultHierarchyRoot, iterator.next());
}
private static Criteria ancestorOf(BranchId child) {
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsRelationLoadingTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsRelationLoadingTest.java
index 9e416fa2d6..beabe73c4f 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsRelationLoadingTest.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsRelationLoadingTest.java
@@ -14,8 +14,6 @@ import static org.eclipse.osee.framework.core.enums.DemoBranches.SAW_Bld_1;
import static org.eclipse.osee.orcs.OrcsIntegrationRule.integrationRule;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import java.util.HashMap;
-import java.util.Map;
import org.eclipse.osee.framework.core.enums.CoreArtifactTokens;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
@@ -52,7 +50,6 @@ public class OrcsRelationLoadingTest {
checkRelationsForSawBranch(orcsApi, queryFactory);
}
- @SuppressWarnings("unchecked")
private void checkRelationsForCommonBranch(OrcsApi oseeApi, QueryFactory queryFactory) throws OseeCoreException {
ArtifactReadable art6 =
@@ -107,12 +104,4 @@ public class OrcsRelationLoadingTest {
assertEquals(3, artifact.getRelated(CoreRelationTypes.Default_Hierarchical__Child).size());
assertEquals(1, artifact.getRelated(CoreRelationTypes.Default_Hierarchical__Parent).size());
}
-
- private Map<Integer, ArtifactReadable> createLookup(Iterable<ArtifactReadable> arts) {
- Map<Integer, ArtifactReadable> lookup = new HashMap<>();
- for (ArtifactReadable artifact : arts) {
- lookup.put(artifact.getLocalId(), artifact);
- }
- return lookup;
- }
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTransactionTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTransactionTest.java
index e72485589c..353951ef0c 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTransactionTest.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTransactionTest.java
@@ -249,7 +249,7 @@ public class OrcsTransactionTest {
ArtifactReadable introduced =
query.fromBranch(topLevelBranch).andIds(SystemUser.Anonymous).getResults().getExactlyOne();
- assertEquals(user.getLocalId(), introduced.getLocalId());
+ assertEquals(user, introduced);
}
@Test
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java
index 9e993d7836..214c344250 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java
@@ -16,7 +16,6 @@ import org.eclipse.osee.framework.core.data.ArtifactToken;
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.HasLocalId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.RelationTypeId;
@@ -31,7 +30,7 @@ import org.eclipse.osee.framework.jdk.core.type.ResultSet;
* @author Roberto E. Escobar
* @author Andrew M. Finkbeiner
*/
-public interface ArtifactReadable extends ArtifactToken, HasLocalId<Integer>, HasTransaction, OrcsReadable {
+public interface ArtifactReadable extends ArtifactToken, HasTransaction, OrcsReadable {
TransactionId getLastModifiedTransaction();
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/BranchQueryBuilder.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/BranchQueryBuilder.java
index db67c51b03..f1a827f5f9 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/BranchQueryBuilder.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/BranchQueryBuilder.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.orcs.search;
import java.util.Collection;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.BranchState;
import org.eclipse.osee.framework.core.enums.BranchType;
@@ -60,6 +61,6 @@ public interface BranchQueryBuilder<T> {
T andIsMergeFor(BranchId source, BranchId destination);
- T andAssociatedArtId(int artId);
+ T andAssociatedArtId(ArtifactId artId);
}

Back to the top