Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2016-08-19 15:43:22 -0400
committerAngel Avila2016-10-04 21:34:50 -0400
commitddb27df8b6912d74a9a38f5a44bbe626681c5c7f (patch)
treea22188e2dab7bd143eaaf747664804d9d43ed556
parent9ce3c17a98857c8c15acef639963017b98a900f2 (diff)
downloadorg.eclipse.osee-ddb27df8b6912d74a9a38f5a44bbe626681c5c7f.tar.gz
org.eclipse.osee-ddb27df8b6912d74a9a38f5a44bbe626681c5c7f.tar.xz
org.eclipse.osee-ddb27df8b6912d74a9a38f5a44bbe626681c5c7f.zip
refactor: Use BranchId with ORCS
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsBranchServiceImpl.java2
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/cache/BranchCache.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/BranchId.java13
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IOseeBranch.java6
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java13
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CreateBranchHttpRequestOperation.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactoryTest.java39
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java1
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactoryTest.java17
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/BranchDataFactoryTest.java24
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/GraphUtilTest.java15
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImplTest.java8
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphDataImplTest.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImplTest.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationManagerTest.java13
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImplTest.java13
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeLoaderImplTest.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImplTest.java38
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionFactoryImplTest.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TxCallableFactoryTest.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManagerTest.java48
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/ArtifactDataFactory.java9
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/AttributeDataFactory.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/DataLoaderFactory.java9
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationDataFactory.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/TransactionData.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/TxOrcsData.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/VersionData.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranch.java8
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaMergeBranchFor.java24
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaTxGetHead.java13
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/OrcsApiImpl.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactory.java13
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java10
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactory.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/BranchDataFactory.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/CreateBranchCallable.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/GraphFactory.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/GraphProvider.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/GraphUtil.java14
-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/graph/impl/GraphDataImpl.java19
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphFactoryImpl.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationFactory.java9
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationManager.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeLoaderImpl.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/script/impl/OrcsScriptInterpreterImpl.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchCriteriaFactory.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchQueryBuilderImpl.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/QueryFactoryImpl.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/TransactionCriteriaFactory.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/TxQueryBuilderImpl.java9
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImpl.java39
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionFactoryImpl.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxData.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataLoaderImpl.java16
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java63
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/BranchProvider.java34
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsConditions.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/ValueProvider.java24
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/IntegrationUtil.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/LoaderTest.java15
-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.java47
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java373
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriterTest.java23
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java20
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/UpdatePreviousTxCurrent.java17
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/BranchCopyTxCallable.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CommitBranchDatabaseTxCallable.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CreateBranchDatabaseTxCallable.java18
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenTxsOnTheSameBranch.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryImpl.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java30
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImpl.java21
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderImpl.java19
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoadSqlContext.java11
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/SqlObjectLoader.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectFactoryImpl.java24
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/TransactionDataImpl.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/TransactionObjectFactory.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/VersionDataImpl.java18
-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/executors/ArtifactQueryContextLoadExecutor.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/LoadExecutor.java13
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/UuidsLoadExecutor.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/ArtifactLoadProcessor.java19
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/AttributeLoadProcessor.java21
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/RelationLoadProcessor.java22
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/TransactionLoadProcessor.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContext.java13
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImpl.java14
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlWriter.java19
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/handlers/MergeBranchForSqlHandler.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/handlers/TxGetHeadSqlHandler.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/ArtifactJoinQuery.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/CommitTransactionDatabaseTxCallable.java13
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/ComodificationCheck.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriter.java10
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderImpl.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/BranchEndpoint.java89
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsCollectorValidatorTest.java16
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsValidationHelperAdapterTest.java13
-rw-r--r--plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/BranchEndpointImpl.java138
-rw-r--r--plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/HtmlWriter.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/IOrcsValidationHelper.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsCollectorValidator.java9
-rw-r--r--plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsValidationHelperAdapter.java9
-rw-r--r--plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsWriterEndpointImpl.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsWriterStreamingOutput.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsWriterWorkbookGenerator.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsPortingTest.java4
-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.test/src/org/eclipse/osee/orcs/api/OrcsTxQueryTest.java5
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/CreateBranchData.java41
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/BranchQueryBuilder.java2
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/TxQueryBuilder.java2
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/transaction/TransactionBuilder.java2
123 files changed, 951 insertions, 1007 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 f49702c0be7..81c5039dca3 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
@@ -104,7 +104,7 @@ public class AtsBranchServiceImpl extends AbstractAtsBranchService {
return false;
}
BranchQuery query = orcsApi.getQueryFactory().branchQuery();
- query = query.andIsMergeFor(workingBranch.getUuid(), destinationBranch.getUuid());
+ query = query.andIsMergeFor(workingBranch, destinationBranch);
return query.getCount() > 0;
}
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/cache/BranchCache.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/cache/BranchCache.java
index 533c1219681..5699f84f15c 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/cache/BranchCache.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/cache/BranchCache.java
@@ -80,4 +80,8 @@ public class BranchCache extends AbstractOseeLoadingCache<Branch> {
public synchronized List<Branch> getBranches(Predicate<Branch> branchFilter) {
return getRawValues().stream().filter(branchFilter).collect(Collectors.toList());
}
+
+ public Branch get(BranchId branch) {
+ return getById(branch.getId());
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/BranchId.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/BranchId.java
index 2c75eade27d..fa98b9f4a01 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/BranchId.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/BranchId.java
@@ -12,9 +12,11 @@ package org.eclipse.osee.framework.core.data;
import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.map.annotate.JsonSerialize;
+import org.eclipse.osee.framework.jdk.core.type.BaseId;
import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.jdk.core.type.IdSerializer;
import org.eclipse.osee.framework.jdk.core.type.Identity;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
/**
* @author Ryan D. Brooks
@@ -38,6 +40,15 @@ public interface BranchId extends Identity<Long>, Id {
@JsonCreator
public static BranchId valueOf(long id) {
- return TokenFactory.createBranch(id);
+ final class BranchIdImpl extends BaseId implements BranchId {
+ public BranchIdImpl(Long id) {
+ super(id);
+ }
+ }
+ return new BranchIdImpl(id);
+ }
+
+ public static BranchId create() {
+ return valueOf(Lib.generateUuid());
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IOseeBranch.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IOseeBranch.java
index 673369777fc..e9b25776a55 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IOseeBranch.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IOseeBranch.java
@@ -28,7 +28,11 @@ public interface IOseeBranch extends BranchId, Named {
return Strings.truncate(getName(), length);
}
- public static IOseeBranch valueOf(Long id, String name) {
+ public static IOseeBranch create(BranchId id, String name) {
+ return create(id.getId(), name);
+ }
+
+ public static IOseeBranch create(Long id, String name) {
final class BranchTokenImpl extends NamedId implements IOseeBranch {
public BranchTokenImpl(Long id, String name) {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java
index 0ac3a45af7a..ae9546bd263 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java
@@ -287,7 +287,7 @@ public final class BranchManager {
public static void setType(BranchId branch, BranchType type) throws OseeCoreException {
BranchEndpoint proxy = ServiceUtil.getOseeClient().getBranchEndpoint();
- Response response = proxy.setBranchType(branch.getId(), type);
+ Response response = proxy.setBranchType(branch, type);
if (response.getStatus() == javax.ws.rs.core.Response.Status.OK.getStatusCode()) {
BranchManager.getBranch(branch).setBranchType(type);
OseeEventManager.kickBranchEvent(BranchManager.class, new BranchEvent(BranchEventType.TypeUpdated, branch));
@@ -296,7 +296,7 @@ public final class BranchManager {
public static void setState(BranchId branch, BranchState state) {
BranchEndpoint proxy = ServiceUtil.getOseeClient().getBranchEndpoint();
- Response response = proxy.setBranchState(branch.getId(), state);
+ Response response = proxy.setBranchState(branch, state);
if (response.getStatus() == javax.ws.rs.core.Response.Status.OK.getStatusCode()) {
BranchManager.getBranch(branch).setBranchState(state);
OseeEventManager.kickBranchEvent(BranchManager.class, new BranchEvent(BranchEventType.StateUpdated, branch));
@@ -305,16 +305,15 @@ public final class BranchManager {
public static void setArchiveState(BranchId branch, BranchArchivedState state) throws OseeCoreException {
BranchEndpoint proxy = ServiceUtil.getOseeClient().getBranchEndpoint();
- Long branchId = branch.getUuid();
if (state.isArchived()) {
- Response response = proxy.archiveBranch(branchId);
+ Response response = proxy.archiveBranch(branch);
if (response.getStatus() == javax.ws.rs.core.Response.Status.OK.getStatusCode()) {
BranchManager.getBranch(branch).setArchived(true);
OseeEventManager.kickBranchEvent(BranchManager.class,
new BranchEvent(BranchEventType.ArchiveStateUpdated, branch));
}
} else {
- Response response = proxy.unarchiveBranch(branchId);
+ Response response = proxy.unarchiveBranch(branch);
if (response.getStatus() == javax.ws.rs.core.Response.Status.OK.getStatusCode()) {
BranchManager.getBranch(branch).setArchived(false);
OseeEventManager.kickBranchEvent(BranchManager.class,
@@ -325,7 +324,7 @@ public final class BranchManager {
public static void setName(BranchId branch, String newBranchName) {
BranchEndpoint proxy = ServiceUtil.getOseeClient().getBranchEndpoint();
- Response response = proxy.setBranchName(branch.getId(), newBranchName);
+ Response response = proxy.setBranchName(branch, newBranchName);
if (response.getStatus() == javax.ws.rs.core.Response.Status.OK.getStatusCode()) {
BranchManager.getBranch(branch).setName(newBranchName);
OseeEventManager.kickBranchEvent(BranchManager.class, new BranchEvent(BranchEventType.Renamed, branch));
@@ -604,7 +603,7 @@ public final class BranchManager {
OseeClient client = ServiceUtil.getOseeClient();
BranchEndpoint proxy = client.getBranchEndpoint();
- Response response = proxy.associateBranchToArtifact(branch.getId(), artifactId);
+ Response response = proxy.associateBranchToArtifact(branch, artifactId);
if (javax.ws.rs.core.Response.Status.OK.getStatusCode() == response.getStatus()) {
getBranch(branch).setAssociatedArtifact(artifactId);
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java
index ff01144f998..8a3d758d305 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java
@@ -95,7 +95,7 @@ public final class CommitBranchHttpRequestOperation extends AbstractOperation {
options.setArchive(isArchiveAllowed);
options.setCommitter(committer);
try {
- Response response = proxy.commitBranch(sourceBranch.getUuid(), destinationBranch.getUuid(), options);
+ Response response = proxy.commitBranch(sourceBranch, destinationBranch, options);
if (Status.CREATED.getStatusCode() == response.getStatus()) {
BranchManager.setState(sourceBranch, BranchState.COMMITTED);
Long txId = getTransactionId(response);
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CreateBranchHttpRequestOperation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CreateBranchHttpRequestOperation.java
index 890af60e0fc..5e5c788661b 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CreateBranchHttpRequestOperation.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CreateBranchHttpRequestOperation.java
@@ -92,7 +92,7 @@ public final class CreateBranchHttpRequestOperation extends AbstractOperation {
data.setTxCopyBranchType(isTxCopyBranchType());
try {
- Response response = proxy.createBranchWithId(branchUuid, data);
+ Response response = proxy.createBranchWithId(BranchId.valueOf(branchUuid), data);
if (Status.CREATED.getStatusCode() == response.getStatus()) {
long branchId = getBranchUuid(response);
newBranch = BranchManager.getBranch(branchId); // can't use TokenFactory here because some places assume branch will be cached such as getBranchesByName
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java
index ced747e0165..6ff3f84e6b0 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java
@@ -58,7 +58,7 @@ public final class PurgeBranchHttpRequestOperation extends AbstractOperation {
OseeClient client = ServiceUtil.getOseeClient();
BranchEndpoint proxy = client.getBranchEndpoint();
try {
- Response response = proxy.purgeBranch(branch.getId(), recursive);
+ Response response = proxy.purgeBranch(branch, recursive);
if (Status.OK.getStatusCode() == response.getStatus()) {
branch.setBranchState(BranchState.PURGED);
branch.setArchived(true);
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactoryTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactoryTest.java
index 7d22bfba373..984adef9693 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactoryTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactoryTest.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.internal.artifact;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
@@ -19,9 +20,9 @@ import static org.mockito.Mockito.when;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
-import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -82,8 +83,6 @@ public class ArtifactFactoryTest {
private ArtifactFactory artifactFactory;
private List<IAttributeType> types;
- private final Long BRANCH_ID = 23L;
-
@Before
public void init() throws OseeCoreException {
MockitoAnnotations.initMocks(this);
@@ -101,10 +100,10 @@ public class ArtifactFactoryTest {
when(artifactData.getGuid()).thenReturn(guid);
when(artifactData.getTypeUuid()).thenReturn(65L);
when(artifactData.getVersion()).thenReturn(artifactVersion);
- when(artifactVersion.getBranchId()).thenReturn(BRANCH_ID);
+ when(artifactVersion.getBranch()).thenReturn(COMMON);
when(source.getOrcsData()).thenReturn(artifactData);
- when(attributeFactory.copyAttribute(any(AttributeData.class), any(Long.class),
+ when(attributeFactory.copyAttribute(any(AttributeData.class), any(BranchId.class),
any(AttributeManager.class))).thenReturn(attribute);
when(otherArtifactData.getLocalId()).thenReturn(45);
@@ -118,11 +117,11 @@ public class ArtifactFactoryTest {
@Test
public void testCreateArtifactFromBranchTypeAndGuid() throws OseeCoreException {
- when(dataFactory.create(BRANCH_ID, artifactType, guid)).thenReturn(artifactData);
+ when(dataFactory.create(COMMON, artifactType, guid)).thenReturn(artifactData);
- Artifact artifact = artifactFactory.createArtifact(session, BRANCH_ID, artifactType, guid);
+ Artifact artifact = artifactFactory.createArtifact(session, COMMON, artifactType, guid);
- verify(dataFactory).create(BRANCH_ID, artifactType, guid);
+ verify(dataFactory).create(COMMON, artifactType, guid);
assertEquals(artifactType, artifact.getArtifactType());
assertEquals(guid, artifact.getGuid());
}
@@ -130,11 +129,11 @@ public class ArtifactFactoryTest {
@Test
public void testCreateArtifactFromBranchTypeAndGuidAndUuid() throws OseeCoreException {
long uuid = 93456L;
- when(dataFactory.create(BRANCH_ID, artifactType, guid, uuid)).thenReturn(artifactData);
+ when(dataFactory.create(COMMON, artifactType, guid, uuid)).thenReturn(artifactData);
- Artifact artifact = artifactFactory.createArtifact(session, BRANCH_ID, artifactType, guid, uuid);
+ Artifact artifact = artifactFactory.createArtifact(session, COMMON, artifactType, guid, uuid);
- verify(dataFactory).create(BRANCH_ID, artifactType, guid, uuid);
+ verify(dataFactory).create(COMMON, artifactType, guid, uuid);
assertEquals(artifactType, artifact.getArtifactType());
assertEquals(guid, artifact.getGuid());
}
@@ -149,7 +148,7 @@ public class ArtifactFactoryTest {
@Test
public void testCopyArtifact() throws OseeCoreException {
- when(dataFactory.copy(BRANCH_ID, artifactData)).thenReturn(otherArtifactData);
+ when(dataFactory.copy(COMMON, artifactData)).thenReturn(otherArtifactData);
when(source.getAttributes(CoreAttributeTypes.Annotation)).thenAnswer(new ReturnAttribute(attribute));
when(attribute.getOrcsData()).thenReturn(attributeData);
@@ -159,12 +158,12 @@ public class ArtifactFactoryTest {
ArgumentCaptor<Artifact> implCapture = ArgumentCaptor.forClass(Artifact.class);
- Artifact actual = artifactFactory.copyArtifact(session, source, types, BRANCH_ID);
+ Artifact actual = artifactFactory.copyArtifact(session, source, types, COMMON);
verify(source, times(0)).getAttributes(CoreAttributeTypes.RelationOrder);
verify(source, times(0)).getAttributes(CoreAttributeTypes.City);
verify(source, times(1)).getAttributes(CoreAttributeTypes.Annotation);
- verify(attributeFactory).copyAttribute(eq(attributeData), eq(BRANCH_ID), implCapture.capture());
+ verify(attributeFactory).copyAttribute(eq(attributeData), eq(COMMON), implCapture.capture());
Assert.assertTrue(implCapture.getValue().isLoaded());
Assert.assertTrue(actual == implCapture.getValue());
@@ -172,7 +171,7 @@ public class ArtifactFactoryTest {
@Test
public void testIntroduceArtifact() throws OseeCoreException {
- when(dataFactory.introduce(BRANCH_ID, artifactData)).thenReturn(otherArtifactData);
+ when(dataFactory.introduce(COMMON, artifactData)).thenReturn(otherArtifactData);
when(source.getExistingAttributeTypes()).thenAnswer(new ReturnExistingTypes(types));
when(source.getAttributes(DeletionFlag.INCLUDE_DELETED)).thenAnswer(new ReturnAttribute(attribute));
@@ -182,15 +181,15 @@ public class ArtifactFactoryTest {
when(attribute.getAttributeType()).thenReturn(CoreAttributeTypes.Annotation);
when(destination.isAttributeTypeValid(CoreAttributeTypes.Annotation)).thenReturn(true);
- Artifact actual = artifactFactory.introduceArtifact(session, source, destination, BRANCH_ID);
+ Artifact actual = artifactFactory.introduceArtifact(session, source, destination, COMMON);
- verify(attributeFactory).introduceAttribute(eq(attributeData), eq(BRANCH_ID), eq(destination));
+ verify(attributeFactory).introduceAttribute(eq(attributeData), eq(COMMON), eq(destination));
Assert.assertTrue(actual == destination);
}
@Test
public void testClone() throws OseeCoreException {
- when(dataFactory.copy(BRANCH_ID, artifactData)).thenReturn(otherArtifactData);
+ when(dataFactory.copy(COMMON, artifactData)).thenReturn(otherArtifactData);
when(source.getExistingAttributeTypes()).thenAnswer(new ReturnExistingTypes(types));
when(source.getAttributes(CoreAttributeTypes.Annotation)).thenAnswer(new ReturnAttribute(attribute));
@@ -200,12 +199,12 @@ public class ArtifactFactoryTest {
ArgumentCaptor<Artifact> implCapture = ArgumentCaptor.forClass(Artifact.class);
- Artifact actual = artifactFactory.copyArtifact(session, source, types, BRANCH_ID);
+ Artifact actual = artifactFactory.copyArtifact(session, source, types, COMMON);
verify(source, times(0)).getAttributes(CoreAttributeTypes.RelationOrder);
verify(source, times(0)).getAttributes(CoreAttributeTypes.City);
verify(source, times(1)).getAttributes(CoreAttributeTypes.Annotation);
- verify(attributeFactory).copyAttribute(eq(attributeData), eq(BRANCH_ID), implCapture.capture());
+ verify(attributeFactory).copyAttribute(eq(attributeData), eq(COMMON), implCapture.capture());
Assert.assertTrue(implCapture.getValue().isLoaded());
Assert.assertTrue(actual == implCapture.getValue());
}
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java
index 5bb3f21904c..fc92d626811 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java
@@ -101,7 +101,6 @@ public class ArtifactTest {
when(artifactData.getVersion()).thenReturn(version);
when(artifactData.getTypeUuid()).thenReturn(artifactType.getGuid());
when(artifactData.getLocalId()).thenReturn(0);
- when(version.getBranchId()).thenReturn(55L);
when(deleted.getModificationType()).thenReturn(ModificationType.ARTIFACT_DELETED);
when(deleted.isDeleted()).thenReturn(true);
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactoryTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactoryTest.java
index b6899b2b6f2..43731e75494 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactoryTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactoryTest.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.internal.attribute;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
@@ -118,7 +118,6 @@ public class AttributeFactoryTest {
when(dataFactory.create(artifactData, attributeType)).thenReturn(attributeData);
when(attributeData.getVersion()).thenReturn(attrVersionData);
when(artifactData.getVersion()).thenReturn(artVersionData);
- when(artVersionData.getBranchId()).thenReturn(45L);
ArgumentCaptor<ResourceNameResolver> resolverCapture = ArgumentCaptor.forClass(ResourceNameResolver.class);
ArgumentCaptor<WeakReference> refCapture = ArgumentCaptor.forClass(WeakReference.class);
@@ -140,18 +139,18 @@ public class AttributeFactoryTest {
public void testCopyAttribute() throws OseeCoreException {
AttributeData copiedAttributeData = mock(AttributeData.class);
- when(dataFactory.copy(COMMON_ID, attributeData)).thenReturn(copiedAttributeData);
+ when(dataFactory.copy(COMMON, attributeData)).thenReturn(copiedAttributeData);
when(copiedAttributeData.getTypeUuid()).thenReturn(expectedGuid);
when(copiedAttributeData.getDataProxy()).thenReturn(proxy);
ArgumentCaptor<ResourceNameResolver> resolverCapture = ArgumentCaptor.forClass(ResourceNameResolver.class);
ArgumentCaptor<WeakReference> refCapture = ArgumentCaptor.forClass(WeakReference.class);
- Attribute<Object> actual = factory.copyAttribute(attributeData, COMMON_ID, container);
+ Attribute<Object> actual = factory.copyAttribute(attributeData, COMMON, container);
assertTrue(attribute == actual);
- verify(dataFactory).copy(COMMON_ID, attributeData);
+ verify(dataFactory).copy(COMMON, attributeData);
verify(proxy).setResolver(resolverCapture.capture());
verify(attribute).internalInitialize(eq(cache), refCapture.capture(), eq(copiedAttributeData), eq(true),
@@ -165,7 +164,7 @@ public class AttributeFactoryTest {
when(attributeData.getVersion()).thenReturn(attrVersionData);
when(attrVersionData.isInStorage()).thenReturn(false);
- Attribute<Object> actual = factory.introduceAttribute(attributeData, COMMON_ID, container);
+ Attribute<Object> actual = factory.introduceAttribute(attributeData, COMMON, container);
assertNull(actual);
}
@@ -177,17 +176,17 @@ public class AttributeFactoryTest {
when(attrVersionData.isInStorage()).thenReturn(true);
when(attributeData.getLocalId()).thenReturn(12345);
- when(dataFactory.introduce(COMMON_ID, attributeData)).thenReturn(introducedAttributeData);
+ when(dataFactory.introduce(COMMON, attributeData)).thenReturn(introducedAttributeData);
when(introducedAttributeData.getTypeUuid()).thenReturn(expectedGuid);
when(introducedAttributeData.getDataProxy()).thenReturn(proxy);
when(container.getAttributeById(attributeData.getLocalId(), DeletionFlag.INCLUDE_DELETED)).thenReturn(
destinationAttribute);
- Attribute<Object> actual = factory.introduceAttribute(attributeData, COMMON_ID, container);
+ Attribute<Object> actual = factory.introduceAttribute(attributeData, COMMON, container);
assertNotNull(actual);
- verify(dataFactory).introduce(COMMON_ID, attributeData);
+ verify(dataFactory).introduce(COMMON, attributeData);
assertEquals(actual, destinationAttribute);
}
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/BranchDataFactoryTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/BranchDataFactoryTest.java
index ed92a9d90c0..3cbe8e61474 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/BranchDataFactoryTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/BranchDataFactoryTest.java
@@ -86,8 +86,8 @@ public class BranchDataFactoryTest {
verify(txQuery).andIsHead(CoreBranches.SYSTEM_ROOT);
String comment = String.format("New Branch from %s (%s)", CoreBranches.SYSTEM_ROOT.getName(), txRecord);
- assertData(result, branch.getName(), branch.getId(), BranchType.BASELINE, comment, txRecord, author,
- ArtifactId.SENTINEL, false);
+ assertData(result, branch.getName(), branch, BranchType.BASELINE, comment, txRecord, author, ArtifactId.SENTINEL,
+ false);
}
@Test
@@ -98,8 +98,8 @@ public class BranchDataFactoryTest {
verify(txQuery).andIsHead(parentBranch);
String comment = String.format("New Branch from %s (%s)", parentBranch.getName(), txRecord.getId());
- assertData(result, branch.getName(), branch.getId(), BranchType.BASELINE, comment, txRecord, author,
- associatedArtifact, false);
+ assertData(result, branch.getName(), branch, BranchType.BASELINE, comment, txRecord, author, associatedArtifact,
+ false);
}
@Test
@@ -110,8 +110,8 @@ public class BranchDataFactoryTest {
verify(txQuery).andIsHead(parentBranch);
String comment = String.format("New Branch from %s (%s)", parentBranch.getName(), txRecord.getId());
- assertData(result, branch.getName(), branch.getId(), BranchType.WORKING, comment, txRecord, author,
- associatedArtifact, false);
+ assertData(result, branch.getName(), branch, BranchType.WORKING, comment, txRecord, author, associatedArtifact,
+ false);
}
@Test
@@ -125,8 +125,8 @@ public class BranchDataFactoryTest {
String comment = String.format("Transaction %d copied from %s to create Branch %s", txRecord.getId(),
parentBranch.getName(), branch.getName());
- assertData(result, branch.getName(), branch.getId(), BranchType.WORKING, comment, txRecord, author,
- ArtifactId.SENTINEL, true);
+ assertData(result, branch.getName(), branch, BranchType.WORKING, comment, txRecord, author, ArtifactId.SENTINEL,
+ true);
}
@Test
@@ -140,13 +140,13 @@ public class BranchDataFactoryTest {
String comment = String.format("Transaction %d ported from %s to create Branch %s", txRecord.getId(),
parentBranch.getName(), branch.getName());
- assertData(result, branch.getName(), branch.getId(), BranchType.PORT, comment, txRecord, author,
- ArtifactId.SENTINEL, true);
+ assertData(result, branch.getName(), branch, BranchType.PORT, comment, txRecord, author, ArtifactId.SENTINEL,
+ true);
}
- private static void assertData(CreateBranchData actual, String branchName, Long branchUuid, BranchType type, String comment, TransactionId fromTx, ArtifactId author, ArtifactId associatedArtifact, boolean isCopyFromTx) {
+ private static void assertData(CreateBranchData actual, String branchName, BranchId branch, BranchType type, String comment, TransactionId fromTx, ArtifactId author, ArtifactId associatedArtifact, boolean isCopyFromTx) {
assertEquals(branchName, actual.getName());
- assertEquals(branchUuid, actual.getGuid());
+ assertEquals(branch, actual.getBranch());
assertEquals(type, actual.getBranchType());
assertEquals(comment, actual.getCreationComment());
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/GraphUtilTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/GraphUtilTest.java
index f7647564970..4255aae17a6 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/GraphUtilTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/GraphUtilTest.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.internal.graph;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.SYSTEM_ROOT_ID;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.SYSTEM_ROOT;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -50,7 +49,7 @@ public class GraphUtilTest {
initMocks(this);
provider = GraphUtil.asProvider(graph);
- when(graph.getBranchId()).thenReturn(COMMON_ID);
+ when(graph.getBranch()).thenReturn(COMMON);
when(graph.getTransaction()).thenReturn(TRANSACTION_ID);
}
@@ -60,8 +59,8 @@ public class GraphUtilTest {
thrown.expect(OseeArgumentException.class);
thrown.expectMessage(String.format("Invalid branch - Graph's branch[%s] does not equals requested branch[%s]",
- COMMON_ID, SYSTEM_ROOT_ID));
- provider.getGraph(session, SYSTEM_ROOT_ID, TRANSACTION_ID);
+ COMMON, SYSTEM_ROOT));
+ provider.getGraph(session, SYSTEM_ROOT, TRANSACTION_ID);
}
@Test
@@ -73,12 +72,12 @@ public class GraphUtilTest {
thrown.expect(OseeArgumentException.class);
thrown.expectMessage(
"Invalid transactionId - Graph's transactionId[231214214] does not equals requested transactionId[123456789]");
- provider.getGraph(session, COMMON_ID, txId);
+ provider.getGraph(session, COMMON, txId);
}
@Test
public void testAsProviderGetName() throws OseeCoreException {
assertNotNull(provider);
- assertEquals(graph, provider.getGraph(session, COMMON_ID, TRANSACTION_ID));
+ assertEquals(graph, provider.getGraph(session, COMMON, TRANSACTION_ID));
}
}
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 cb5cf68d70f..b4a6e7aa353 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
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.internal.graph.impl;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@@ -88,9 +88,9 @@ public class GraphBuilderImplTest {
builder = new GraphBuilderImpl(logger, artifactFactory, attributeFactory, relationFactory, graphProvider);
when(description.getSession()).thenReturn(session);
- when(description.getBranchId()).thenReturn(COMMON_ID);
+ when(description.getBranch()).thenReturn(COMMON);
when(description.getTransaction()).thenReturn(TRANSACTION_ID);
- when(graphProvider.getGraph(session, COMMON_ID, TRANSACTION_ID)).thenReturn(graphData);
+ when(graphProvider.getGraph(session, COMMON, TRANSACTION_ID)).thenReturn(graphData);
when(relationFactory.createRelationContainer()).thenReturn(adjacencies);
when(relationFactory.createRelation(relationData)).thenReturn(relation);
@@ -117,7 +117,7 @@ public class GraphBuilderImplTest {
builder.onLoadDescription(description);
builder.onLoadEnd();
- verify(description).getBranchId();
+ verify(description).getBranch();
verify(description).getTransaction();
}
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphDataImplTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphDataImplTest.java
index 35ff9b2e1d0..c03b899ba5e 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphDataImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphDataImplTest.java
@@ -22,8 +22,8 @@ import static org.mockito.Mockito.when;
import java.util.Collection;
import java.util.List;
import org.eclipse.osee.framework.core.data.BranchId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.data.TransactionId;
+import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.logger.Log;
@@ -87,7 +87,7 @@ public class GraphDataImplTest {
@Mock private Relation relation3;
@Mock private OrcsSession session;
- private final BranchId branch = TokenFactory.createBranch(0L);
+ private final BranchId branch = CoreBranches.COMMON;
// @formatter:on
@@ -98,7 +98,13 @@ public class GraphDataImplTest {
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
- graph = new GraphDataImpl(session, branch.getId(), TRANSACTION_ID);
+ graph = new GraphDataImpl(session, branch, TRANSACTION_ID);
+ when(artifact.getBranch()).thenReturn(branch);
+ when(artifact1.getBranch()).thenReturn(branch);
+ when(artifact2.getBranch()).thenReturn(branch);
+ when(container.getBranch()).thenReturn(branch);
+ when(container1.getBranch()).thenReturn(branch);
+ when(container2.getBranch()).thenReturn(branch);
}
@Test
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 24030f515cc..ce7dfdaad78 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
@@ -13,7 +13,7 @@ package org.eclipse.osee.orcs.core.internal.proxy.impl;
import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.Active;
import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.Annotation;
import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.Name;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.eclipse.osee.framework.core.enums.CoreRelationTypes.Allocation__Requirement;
import static org.eclipse.osee.framework.core.enums.CoreRelationTypes.Default_Hierarchical__Child;
import static org.eclipse.osee.framework.core.enums.CoreRelationTypes.Default_Hierarchical__Parent;
@@ -31,11 +31,11 @@ import java.util.Collections;
import java.util.Date;
import java.util.List;
import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.data.IRelationTypeSide;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
@@ -108,12 +108,12 @@ public class ArtifactReadOnlyImplTest {
@Test
public void testGetBranchUuid() {
- when(proxiedObject.getBranchId()).thenReturn(COMMON_ID);
+ when(proxiedObject.getBranch()).thenReturn(COMMON);
- Long actual = readOnly.getBranchId();
+ BranchId actual = readOnly.getBranch();
- assertEquals(COMMON_ID, actual);
- verify(proxiedObject).getBranchId();
+ assertEquals(COMMON, actual);
+ verify(proxiedObject).getBranch();
}
@Test
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationManagerTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationManagerTest.java
index 4e1576890d6..b118a65e502 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationManagerTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationManagerTest.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.internal.relation;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.eclipse.osee.framework.core.enums.DeletionFlag.INCLUDE_DELETED;
import static org.eclipse.osee.framework.core.enums.RelationOrderBaseTypes.LEXICOGRAPHICAL_DESC;
import static org.eclipse.osee.orcs.core.internal.relation.RelationUtil.DEFAULT_HIERARCHY;
@@ -130,6 +131,13 @@ public class RelationManagerTest {
when(node5.getLocalId()).thenReturn(55);
when(node6.getLocalId()).thenReturn(66);
+ when(node1.getBranch()).thenReturn(COMMON);
+ when(node2.getBranch()).thenReturn(COMMON);
+ when(node3.getBranch()).thenReturn(COMMON);
+ when(node4.getBranch()).thenReturn(COMMON);
+ when(node5.getBranch()).thenReturn(COMMON);
+ when(node6.getBranch()).thenReturn(COMMON);
+
when(node1.getName()).thenReturn("z");
when(node2.getName()).thenReturn("y");
when(node3.getName()).thenReturn("x");
@@ -305,14 +313,13 @@ public class RelationManagerTest {
@Test
public void testIntroduce() throws OseeCoreException {
- Long branchId = 1L;
when(types.isArtifactTypeAllowed(CoreRelationTypes.Default_Hierarchical__Parent, RelationSide.SIDE_A,
CoreArtifactTypes.SoftwareRequirement)).thenReturn(true);
when(types.getMultiplicity(CoreRelationTypes.Default_Hierarchical__Parent)).thenReturn(
RelationTypeMultiplicity.ONE_TO_MANY);
- when(relationFactory.introduce(branchId, data1)).thenReturn(relation1);
+ when(relationFactory.introduce(COMMON, data1)).thenReturn(relation1);
- manager.introduce(session, branchId, node2, node3);
+ manager.introduce(session, COMMON, node2, node3);
RelationNodeAdjacencies node2Adj = node2.getGraph().getAdjacencies(node2);
RelationNodeAdjacencies node3Adj = node3.getGraph().getAdjacencies(node3);
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImplTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImplTest.java
index 539a404012f..49b56c4fc9b 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImplTest.java
@@ -10,8 +10,8 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.internal.relation.impl;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.SYSTEM_ROOT_ID;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.SYSTEM_ROOT;
import static org.eclipse.osee.framework.core.enums.CoreRelationTypes.Default_Hierarchical__Child;
import static org.eclipse.osee.framework.core.enums.DeletionFlag.EXCLUDE_DELETED;
import static org.eclipse.osee.framework.core.enums.DeletionFlag.INCLUDE_DELETED;
@@ -158,6 +158,10 @@ public class RelationManagerImplTest {
when(node5.getGraph()).thenReturn(graph);
when(node6.getGraph()).thenReturn(graph);
+ when(node1.getBranch()).thenReturn(COMMON);
+ when(node2.getBranch()).thenReturn(COMMON);
+ when(node3.getBranch()).thenReturn(SYSTEM_ROOT);
+
when(graph.getTransaction()).thenReturn(TransactionId.SENTINEL);
when(graph.getAdjacencies(node1)).thenReturn(container1);
@@ -418,12 +422,9 @@ public class RelationManagerImplTest {
@Test
public void testRelateErrorOnDifferentBranches() throws OseeCoreException {
- when(node1.getBranchId()).thenReturn(SYSTEM_ROOT_ID);
- when(node2.getBranchId()).thenReturn(COMMON_ID);
-
thrown.expect(OseeArgumentException.class);
thrown.expectMessage("Cross branch linking is not yet supported.");
- manager.relate(session, node1, typeAndSide1, node2);
+ manager.relate(session, node2, typeAndSide1, node3);
}
@Test
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeLoaderImplTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeLoaderImplTest.java
index 98cf4a0bb19..12febe5c99c 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeLoaderImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeLoaderImplTest.java
@@ -17,7 +17,6 @@ import static org.mockito.MockitoAnnotations.initMocks;
import java.util.Arrays;
import java.util.Collection;
import org.eclipse.osee.framework.core.data.BranchId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.enums.LoadLevel;
@@ -68,7 +67,7 @@ public class RelationNodeLoaderImplTest {
relationNode = new RelationNodeLoaderImpl(dataLoaderFactory, graphBuilderFactory);
- when(graph.getBranchId()).thenReturn(BRANCH.getUuid());
+ when(graph.getBranch()).thenReturn(BRANCH);
when(graph.getTransaction()).thenReturn(TRANSACTION_ID);
}
@@ -76,13 +75,13 @@ public class RelationNodeLoaderImplTest {
public void testLoadNodes() throws OseeCoreException {
Iterable<Artifact> artifacts = Arrays.asList(artifact);
- when(dataLoaderFactory.newDataLoaderFromIds(session, BRANCH.getUuid(), ids)).thenReturn(loader);
+ when(dataLoaderFactory.newDataLoaderFromIds(session, BRANCH, ids)).thenReturn(loader);
when(graphBuilderFactory.createBuilderForGraph(graph)).thenReturn(builder);
when(builder.getArtifacts()).thenReturn(artifacts);
Iterable<RelationNode> actual = relationNode.loadNodes(session, graph, ids, LoadLevel.ALL);
- verify(dataLoaderFactory).newDataLoaderFromIds(session, BRANCH.getUuid(), ids);
+ verify(dataLoaderFactory).newDataLoaderFromIds(session, BRANCH, ids);
verify(graphBuilderFactory).createBuilderForGraph(graph);
verify(loader).withLoadLevel(LoadLevel.ALL);
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImplTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImplTest.java
index fd405c7e544..2f37b051146 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImplTest.java
@@ -21,6 +21,7 @@ import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.PlainText
import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.QualificationMethod;
import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.RelationOrder;
import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.WordTemplateContent;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.eclipse.osee.framework.core.enums.RelationOrderBaseTypes.LEXICOGRAPHICAL_ASC;
import static org.eclipse.osee.framework.core.enums.RelationOrderBaseTypes.LEXICOGRAPHICAL_DESC;
import static org.eclipse.osee.framework.core.enums.RelationSide.SIDE_B;
@@ -40,13 +41,11 @@ import java.util.Collections;
import java.util.List;
import org.eclipse.osee.executor.admin.CancellableCallable;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.data.IRelationTypeSide;
import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
@@ -92,8 +91,6 @@ public class TransactionBuilderImplTest {
@Mock private QueryModule query;
@Mock private KeyValueOps keyValueOps;
- @Mock private BranchId branch;
-
@Mock private ArtifactReadable expectedAuthor;
@Mock private ArtifactReadable expectedDestination;
@Mock private ArtifactReadable node1;
@@ -108,8 +105,6 @@ public class TransactionBuilderImplTest {
@Mock private TxData txData;
// @formatter:on
- private final BranchId expectedBranch = CoreBranches.COMMON;
- private final Long BRANCH_ID = expectedBranch.getUuid();
private TransactionBuilderImpl factory;
private String guid;
@@ -124,21 +119,20 @@ public class TransactionBuilderImplTest {
when(txDataManager.getForWrite(txData, expectedAuthor)).thenReturn(artifact);
when(artifact.getAttributeById(attrId.getLocalId())).thenReturn(attribute);
when(query.createQueryFactory(session)).thenReturn(queryFactory);
+ when(expectedAuthor.getBranch()).thenReturn(COMMON);
+ when(txData.getBranch()).thenReturn(COMMON);
}
@Test
public void testGetComment() {
when(factory.getComment()).thenReturn("This is a comment");
-
String comment = factory.getComment();
-
assertEquals(comment, "This is a comment");
verify(txData).getComment();
}
public void testSetAuthor() throws OseeCoreException {
factory.setAuthor(expectedAuthor);
-
verify(txDataManager).setAuthor(txData, expectedAuthor);
}
@@ -158,49 +152,41 @@ public class TransactionBuilderImplTest {
@Test
public void testCopyArtifact() throws OseeCoreException {
- when(expectedAuthor.getBranchId()).thenReturn(BRANCH_ID);
-
factory.copyArtifact(expectedAuthor);
-
- verify(txDataManager).copyArtifact(txData, BRANCH_ID, expectedAuthor);
+ verify(txDataManager).copyArtifact(txData, COMMON, expectedAuthor);
}
@Test
public void testCopyArtifactWithList() throws OseeCoreException {
Collection<? extends IAttributeType> attributesToDuplicate = Arrays.asList(Name, Annotation);
- when(expectedAuthor.getBranchId()).thenReturn(BRANCH_ID);
factory.copyArtifact(expectedAuthor, attributesToDuplicate);
- verify(txDataManager).copyArtifact(txData, BRANCH_ID, expectedAuthor, attributesToDuplicate);
+ verify(txDataManager).copyArtifact(txData, COMMON, expectedAuthor, attributesToDuplicate);
}
@Test
public void testIntroduceArtifactBranchException() throws OseeCoreException {
- when(expectedAuthor.getBranchId()).thenReturn(BRANCH_ID);
- when(txData.getBranchId()).thenReturn(BRANCH_ID);
- when(txData.isOnBranch(BRANCH_ID)).thenReturn(true);
+ when(txData.isOnBranch(COMMON)).thenReturn(true);
thrown.expect(OseeArgumentException.class);
- thrown.expectMessage("Source branch is same branch as transaction branch[" + BRANCH_ID + "]");
- factory.introduceArtifact(expectedBranch, expectedAuthor);
+ thrown.expectMessage("Source branch is same branch as transaction branch[" + COMMON + "]");
+ factory.introduceArtifact(COMMON, expectedAuthor);
}
@Test
public void testIntroduceArtifact() throws OseeCoreException {
- when(query.createQueryFactory(null)).thenReturn(queryFactory);
- when(queryFactory.fromBranch(any(Long.class))).thenReturn(builder);
-
- when(queryFactory.fromBranch(branch)).thenReturn(builder);
+ when(query.createQueryFactory(any())).thenReturn(queryFactory);
+ when(queryFactory.fromBranch(COMMON)).thenReturn(builder);
when(builder.includeDeletedArtifacts()).thenReturn(builder);
when(builder.andId(any())).thenReturn(builder);
ResultSet<ArtifactReadable> source = ResultSets.singleton(expectedAuthor);
when(builder.getResults()).thenReturn(source);
- factory.introduceArtifact(expectedBranch, expectedAuthor);
+ factory.introduceArtifact(COMMON, expectedAuthor);
- verify(txDataManager).introduceArtifact(txData, BRANCH_ID, expectedAuthor, expectedAuthor);
+ verify(txDataManager).introduceArtifact(txData, COMMON, expectedAuthor, expectedAuthor);
}
@Test
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionFactoryImplTest.java
index 9b371edc831..97994f8d738 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionFactoryImplTest.java
@@ -94,14 +94,14 @@ public class TransactionFactoryImplTest {
public void testCreateTransaction() throws OseeCoreException {
String expectedComment = "This is my comment";
- when(txDataManager.createTxData(session, expectedBranch.getUuid())).thenReturn(txData);
+ when(txDataManager.createTxData(session, expectedBranch)).thenReturn(txData);
when(txData.getAuthor()).thenReturn(expectedAuthor);
- when(txData.getBranchId()).thenReturn(expectedBranch.getUuid());
+ when(txData.getBranch()).thenReturn(expectedBranch);
when(txData.getComment()).thenReturn(expectedComment);
TransactionBuilder tx = factory.createTransaction(expectedBranch, expectedAuthor, expectedComment);
assertNotNull(tx);
- assertEquals(expectedBranch.getUuid(), tx.getBranchId());
+ assertEquals(expectedBranch, tx.getBranch());
assertEquals(expectedComment, tx.getComment());
}
}
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TxCallableFactoryTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TxCallableFactoryTest.java
index 75c5612f841..2a702cc3d3c 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TxCallableFactoryTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TxCallableFactoryTest.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.internal.transaction;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -21,7 +22,6 @@ import static org.mockito.Mockito.when;
import java.util.Collection;
import java.util.Collections;
import java.util.concurrent.Callable;
-import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.logger.Log;
@@ -67,7 +67,6 @@ public class TxCallableFactoryTest {
@Mock private TxDataLoader loader;
@Mock private TupleManager tupleManager;
- @Mock private BranchId branch;
@Mock private GraphData graph;
@Mock private TxDataStore txDataStore;
@@ -88,6 +87,7 @@ public class TxCallableFactoryTest {
txManager = new TxDataManager(proxyManager, artifactFactory, relationManager, tupleManager, loader);
txFactory = new TxCallableFactory(logger, txDataStore, txManager);
data = new TxData(session, graph);
+ when(graph.getBranch()).thenReturn(COMMON);
}
@@ -130,7 +130,7 @@ public class TxCallableFactoryTest {
assertFalse(data.isCommitInProgress());
TransactionData data = txData.getValue();
- assertEquals(branch.getUuid(), data.getBranchId());
+ assertEquals(COMMON, data.getBranch());
assertEquals(userArtifact, data.getAuthor());
assertEquals("My Comment", data.getComment());
}
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManagerTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManagerTest.java
index 1e5da553ea0..2c9524c88cd 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManagerTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManagerTest.java
@@ -13,7 +13,7 @@ package org.eclipse.osee.orcs.core.internal.transaction;
import static org.eclipse.osee.framework.core.enums.CoreArtifactTypes.DirectSoftwareRequirement;
import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.Category;
import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.Name;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.eclipse.osee.framework.core.enums.RelationOrderBaseTypes.LEXICOGRAPHICAL_DESC;
import static org.eclipse.osee.framework.core.enums.RelationSide.SIDE_A;
import static org.eclipse.osee.orcs.core.internal.relation.RelationUtil.DEFAULT_HIERARCHY;
@@ -115,8 +115,6 @@ public class TxDataManagerTest {
private String r2Guid;
private String r3Guid;
- private static final Long BRANCH_ID = 111L;
-
@Before
public void init() throws OseeCoreException {
MockitoAnnotations.initMocks(this);
@@ -132,7 +130,7 @@ public class TxDataManagerTest {
when(txData.getSession()).thenReturn(session);
when(txData.getGraph()).thenReturn(graph);
- when(graph.getBranchId()).thenReturn(BRANCH_ID);
+ when(graph.getBranch()).thenReturn(COMMON);
txDataReal = new TxData(session, graph);
r1Guid = GUID.create();
@@ -147,7 +145,7 @@ public class TxDataManagerTest {
when(readable2.getGuid()).thenReturn(r2Guid);
when(readable3.getGuid()).thenReturn(r3Guid);
- when(readable1.getBranchId()).thenReturn(BRANCH_ID);
+ when(readable1.getBranch()).thenReturn(COMMON);
when(artifact1.getGuid()).thenReturn(r1Guid);
when(artifact2.getGuid()).thenReturn(r2Guid);
@@ -159,7 +157,7 @@ public class TxDataManagerTest {
@Test
public void testCreateTxData() throws OseeCoreException {
- TxData newData = txDataManager.createTxData(session, BRANCH_ID);
+ TxData newData = txDataManager.createTxData(session, COMMON);
assertNotNull(newData);
}
@@ -382,7 +380,7 @@ public class TxDataManagerTest {
@Test
public void testCreateArtifact() throws OseeCoreException {
- when(artifactFactory.createArtifact(session, BRANCH_ID, DirectSoftwareRequirement, guid)).thenReturn(artifact1);
+ when(artifactFactory.createArtifact(session, COMMON, DirectSoftwareRequirement, guid)).thenReturn(artifact1);
when(proxyManager.asExternalArtifact(session, artifact1)).thenReturn(readable1);
ArtifactData data = Mockito.mock(ArtifactData.class);
@@ -392,7 +390,7 @@ public class TxDataManagerTest {
ArtifactReadable actual =
txDataManager.createArtifact(txDataReal, DirectSoftwareRequirement, "Direct SW requirement", guid);
- verify(artifactFactory).createArtifact(session, BRANCH_ID, DirectSoftwareRequirement, guid);
+ verify(artifactFactory).createArtifact(session, COMMON, DirectSoftwareRequirement, guid);
assertEquals(readable1, actual);
}
@@ -400,7 +398,7 @@ public class TxDataManagerTest {
public void testCopyExisitingArtifact() throws OseeCoreException {
txDataReal.add(artifact1);
- when(artifactFactory.copyArtifact(session, artifact1, types, BRANCH_ID)).thenReturn(artifact2);
+ when(artifactFactory.copyArtifact(session, artifact1, types, COMMON)).thenReturn(artifact2);
when(proxyManager.asExternalArtifact(session, artifact2)).thenReturn(readable2);
ArtifactData data = Mockito.mock(ArtifactData.class);
@@ -408,9 +406,9 @@ public class TxDataManagerTest {
when(artifact2.getOrcsData()).thenReturn(data);
when(data.isExistingVersionUsed()).thenReturn(false);
- ArtifactReadable actual = txDataManager.copyArtifact(txDataReal, BRANCH_ID, readable1);
+ ArtifactReadable actual = txDataManager.copyArtifact(txDataReal, COMMON, readable1);
- verify(artifactFactory).copyArtifact(session, artifact1, types, BRANCH_ID);
+ verify(artifactFactory).copyArtifact(session, artifact1, types, COMMON);
verify(proxyManager).asExternalArtifact(session, artifact2);
assertEquals(readable2, actual);
@@ -425,13 +423,13 @@ public class TxDataManagerTest {
when(artifact2.getOrcsData()).thenReturn(data);
when(data.isExistingVersionUsed()).thenReturn(false);
- when(artifactFactory.copyArtifact(session, artifact1, types, BRANCH_ID)).thenReturn(artifact2);
+ when(artifactFactory.copyArtifact(session, artifact1, types, COMMON)).thenReturn(artifact2);
when(proxyManager.asExternalArtifact(session, artifact2)).thenReturn(readable2);
- ArtifactReadable actual = txDataManager.copyArtifact(txDataReal, BRANCH_ID, readable1);
+ ArtifactReadable actual = txDataManager.copyArtifact(txDataReal, COMMON, readable1);
verify(proxyManager).asInternalArtifact(readable1);
- verify(artifactFactory).copyArtifact(session, artifact1, types, BRANCH_ID);
+ verify(artifactFactory).copyArtifact(session, artifact1, types, COMMON);
verify(proxyManager).asExternalArtifact(session, artifact2);
assertEquals(readable2, actual);
@@ -444,7 +442,7 @@ public class TxDataManagerTest {
ArtifactData data = Mockito.mock(ArtifactData.class);
VersionData version = Mockito.mock(VersionData.class);
when(data.getVersion()).thenReturn(version);
- when(version.getBranchId()).thenReturn(BRANCH_ID);
+ when(version.getBranch()).thenReturn(COMMON);
Artifact sourceArtifact = Mockito.spy(new ArtifactImpl(null, data, null));
@@ -456,12 +454,12 @@ public class TxDataManagerTest {
when(artifact2.getOrcsData()).thenReturn(data);
when(data.isExistingVersionUsed()).thenReturn(false);
- when(artifactFactory.copyArtifact(session, sourceArtifact, copyTypes, BRANCH_ID)).thenReturn(artifact2);
+ when(artifactFactory.copyArtifact(session, sourceArtifact, copyTypes, COMMON)).thenReturn(artifact2);
when(proxyManager.asExternalArtifact(session, artifact2)).thenReturn(readable2);
- ArtifactReadable actual = txDataManager.copyArtifact(txDataReal, BRANCH_ID, sourceArtifact);
+ ArtifactReadable actual = txDataManager.copyArtifact(txDataReal, COMMON, sourceArtifact);
- verify(artifactFactory).copyArtifact(session, sourceArtifact, copyTypes, BRANCH_ID);
+ verify(artifactFactory).copyArtifact(session, sourceArtifact, copyTypes, COMMON);
assertEquals(readable2, actual);
}
@@ -471,7 +469,7 @@ public class TxDataManagerTest {
txDataReal.add(artifact1);
when(artifact1.getExistingAttributeTypes()).thenAnswer(answerValue(types));
- when(artifactFactory.copyArtifact(session, artifact1, types, BRANCH_ID)).thenReturn(artifact2);
+ when(artifactFactory.copyArtifact(session, artifact1, types, COMMON)).thenReturn(artifact2);
when(proxyManager.asExternalArtifact(session, artifact2)).thenReturn(readable2);
ArtifactData data = Mockito.mock(ArtifactData.class);
@@ -479,9 +477,9 @@ public class TxDataManagerTest {
when(artifact2.getOrcsData()).thenReturn(data);
when(data.isExistingVersionUsed()).thenReturn(false);
- ArtifactReadable actual = txDataManager.copyArtifact(txDataReal, BRANCH_ID, artifactId1);
+ ArtifactReadable actual = txDataManager.copyArtifact(txDataReal, COMMON, artifactId1);
- verify(artifactFactory).copyArtifact(session, artifact1, types, BRANCH_ID);
+ verify(artifactFactory).copyArtifact(session, artifact1, types, COMMON);
verify(proxyManager).asExternalArtifact(session, artifact2);
assertEquals(readable2, actual);
@@ -490,8 +488,8 @@ public class TxDataManagerTest {
@Test
public void testIntroduceArtifact() throws OseeCoreException {
ResultSet<Artifact> loaded = ResultSets.singleton(artifact1);
- when(loader.loadArtifacts(eq(session), eq(COMMON_ID), anyCollectionOf(ArtifactId.class))).thenReturn(loaded);
- when(artifactFactory.introduceArtifact(session, artifact1, artifact1, BRANCH_ID)).thenReturn(artifact2);
+ when(loader.loadArtifacts(eq(session), eq(COMMON), anyCollectionOf(ArtifactId.class))).thenReturn(loaded);
+ when(artifactFactory.introduceArtifact(session, artifact1, artifact1, COMMON)).thenReturn(artifact2);
when(proxyManager.asExternalArtifact(session, artifact2)).thenReturn(readable2);
when(artifact1.getGraph()).thenReturn(graph);
when(graph.getAdjacencies(artifact1)).thenReturn(adjacencies);
@@ -501,9 +499,9 @@ public class TxDataManagerTest {
when(artifact2.getOrcsData()).thenReturn(data);
when(data.isExistingVersionUsed()).thenReturn(false);
- ArtifactReadable actual = txDataManager.introduceArtifact(txDataReal, COMMON_ID, readable1, readable2);
+ ArtifactReadable actual = txDataManager.introduceArtifact(txDataReal, COMMON, readable1, readable2);
- verify(artifactFactory).introduceArtifact(session, artifact1, artifact1, BRANCH_ID);
+ verify(artifactFactory).introduceArtifact(session, artifact1, artifact1, COMMON);
verify(proxyManager).asExternalArtifact(session, artifact1);
assertEquals(readable1, actual);
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/ArtifactDataFactory.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/ArtifactDataFactory.java
index 4b174231676..2f78ce50475 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/ArtifactDataFactory.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/ArtifactDataFactory.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.ds;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -18,14 +19,14 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
*/
public interface ArtifactDataFactory {
- ArtifactData create(Long branch, IArtifactType artifactType, String guid) throws OseeCoreException;
+ ArtifactData create(BranchId branch, IArtifactType artifactType, String guid) throws OseeCoreException;
- ArtifactData create(Long branch, IArtifactType artifactType, String guid, long artifactId) throws OseeCoreException;
+ ArtifactData create(BranchId branch, IArtifactType artifactType, String guid, long artifactId) throws OseeCoreException;
- ArtifactData copy(Long destination, ArtifactData source) throws OseeCoreException;
+ ArtifactData copy(BranchId destination, ArtifactData source) throws OseeCoreException;
ArtifactData clone(ArtifactData source) throws OseeCoreException;
- ArtifactData introduce(Long destination, ArtifactData source) throws OseeCoreException;
+ ArtifactData introduce(BranchId destination, ArtifactData source) throws OseeCoreException;
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/AttributeDataFactory.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/AttributeDataFactory.java
index 9fe5ec3eb05..f961013ed8a 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/AttributeDataFactory.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/AttributeDataFactory.java
@@ -10,7 +10,9 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.ds;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IAttributeType;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
/**
@@ -20,10 +22,10 @@ public interface AttributeDataFactory {
AttributeData create(ArtifactData parent, IAttributeType attributeType) throws OseeCoreException;
- AttributeData copy(Long destination, AttributeData orcsData) throws OseeCoreException;
+ AttributeData copy(BranchId destination, AttributeData orcsData) throws OseeCoreException;
AttributeData clone(AttributeData source) throws OseeCoreException;
- AttributeData introduce(Long destination, AttributeData source) throws OseeCoreException;
+ AttributeData introduce(BranchId destination, AttributeData source) throws OseeCoreException;
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/DataLoaderFactory.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/DataLoaderFactory.java
index 4c2bf96fd05..c74b41a28dc 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/DataLoaderFactory.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/DataLoaderFactory.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.orcs.core.ds;
import java.util.Collection;
import org.eclipse.osee.executor.admin.HasCancellation;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.orcs.OrcsSession;
@@ -24,12 +25,12 @@ public interface DataLoaderFactory {
DataLoader newDataLoader(QueryContext queryContext) throws OseeCoreException;
- DataLoader newDataLoaderFromIds(OrcsSession session, Long branchId, Integer... artifactIds) throws OseeCoreException;
+ DataLoader newDataLoaderFromIds(OrcsSession session, BranchId branch, Integer... artifactIds) throws OseeCoreException;
- DataLoader newDataLoaderFromIds(OrcsSession session, Long branchId, Collection<Integer> artifactIds) throws OseeCoreException;
+ DataLoader newDataLoaderFromIds(OrcsSession session, BranchId branch, Collection<Integer> artifactIds) throws OseeCoreException;
- DataLoader newDataLoaderFromGuids(OrcsSession session, Long branchId, String... artifactGuids) throws OseeCoreException;
+ DataLoader newDataLoaderFromGuids(OrcsSession session, BranchId branch, String... artifactGuids) throws OseeCoreException;
- DataLoader newDataLoaderFromGuids(OrcsSession session, Long branchId, Collection<String> artifactGuids) throws OseeCoreException;
+ DataLoader newDataLoaderFromGuids(OrcsSession session, BranchId branch, Collection<String> artifactGuids) throws OseeCoreException;
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationDataFactory.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationDataFactory.java
index cc86fb2354f..3362839621e 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationDataFactory.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationDataFactory.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.ds;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.HasLocalId;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -19,9 +20,9 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
*/
public interface RelationDataFactory {
- RelationData createRelationData(IRelationType relationType, Long branch, HasLocalId<Integer> aArt, HasLocalId<Integer> bArt, String rationale) throws OseeCoreException;
+ RelationData createRelationData(IRelationType relationType, BranchId branch, HasLocalId<Integer> aArt, HasLocalId<Integer> bArt, String rationale) throws OseeCoreException;
RelationData clone(RelationData source) throws OseeCoreException;
- RelationData introduce(Long branch, RelationData source) throws OseeCoreException;
+ RelationData introduce(BranchId branch, RelationData source) throws OseeCoreException;
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/TransactionData.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/TransactionData.java
index 9dd326e6645..27b85532160 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/TransactionData.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/TransactionData.java
@@ -11,10 +11,11 @@
package org.eclipse.osee.orcs.core.ds;
import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.BranchId;
public interface TransactionData extends HasOrcsChangeSet {
- Long getBranchId();
+ BranchId getBranch();
ArtifactId getAuthor();
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/TxOrcsData.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/TxOrcsData.java
index e7c46093eda..0ce46e9824d 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/TxOrcsData.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/TxOrcsData.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.orcs.core.ds;
import java.util.Date;
import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
import org.eclipse.osee.orcs.data.TransactionReadable;
@@ -22,7 +23,7 @@ public interface TxOrcsData extends TransactionReadable {
void setAuthor(ArtifactId author);
- void setBranchId(Long branchId);
+ void setBranch(BranchId branch);
void setComment(String comment);
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 4870e23e4d5..c177b481ed5 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
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.ds;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.TransactionId;
/**
@@ -29,9 +30,9 @@ public interface VersionData extends Cloneable {
void setStripeId(TransactionId stripeId);
- Long getBranchId();
+ BranchId getBranch();
- void setBranchId(Long branchId);
+ void setBranch(BranchId branch);
boolean isInStorage();
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranch.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranch.java
index 4e2ba959524..1c428900f02 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranch.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranch.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.ds.criteria;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.HasBranch;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
@@ -21,9 +22,9 @@ import org.eclipse.osee.orcs.core.ds.Options;
*/
public class CriteriaBranch extends Criteria implements HasBranch, BranchCriteria {
- private final Long branchId;
+ private final BranchId branchId;
- public CriteriaBranch(Long branchId) {
+ public CriteriaBranch(BranchId branchId) {
this.branchId = branchId;
}
@@ -33,7 +34,7 @@ public class CriteriaBranch extends Criteria implements HasBranch, BranchCriteri
}
@Override
- public Long getBranchId() {
+ public BranchId getBranch() {
return branchId;
}
@@ -41,5 +42,4 @@ public class CriteriaBranch extends Criteria implements HasBranch, BranchCriteri
public String toString() {
return "CriteriaBranch [branch=" + branchId + "]";
}
-
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaMergeBranchFor.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaMergeBranchFor.java
index d57b07d007c..9cdb87a0109 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaMergeBranchFor.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaMergeBranchFor.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.ds.criteria;
+import org.eclipse.osee.framework.core.data.BranchId;
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,30 +21,31 @@ import org.eclipse.osee.orcs.core.ds.Options;
*/
public class CriteriaMergeBranchFor extends Criteria implements BranchCriteria {
- private final Long sourceUuid, destUuid;
+ private final BranchId source;
+ private final BranchId destination;
- public CriteriaMergeBranchFor(Long sourceUuid, Long destUuid) {
+ public CriteriaMergeBranchFor(BranchId source, BranchId destination) {
super();
- this.sourceUuid = sourceUuid;
- this.destUuid = destUuid;
+ this.source = source;
+ this.destination = destination;
}
- public Long getSourceUuid() {
- return sourceUuid;
+ public BranchId getSource() {
+ return source;
}
- public Long getDestUuid() {
- return destUuid;
+ public BranchId getDestination() {
+ return destination;
}
@Override
public void checkValid(Options options) throws OseeCoreException {
- Conditions.checkExpressionFailOnTrue(sourceUuid == null, "Source Uuid cannot be null");
- Conditions.checkExpressionFailOnTrue(destUuid == null, "Destination Uuid cannot be null");
+ Conditions.checkExpressionFailOnTrue(source == null, "Source Uuid cannot be null");
+ Conditions.checkExpressionFailOnTrue(destination == null, "Destination Uuid cannot be null");
}
@Override
public String toString() {
- return "CriteriaMergeBranchFor [source=" + sourceUuid + ", destination=" + destUuid + "]";
+ return "CriteriaMergeBranchFor [source=" + source + ", destination=" + destination + "]";
}
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaTxGetHead.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaTxGetHead.java
index b004df5e930..6ffc8eebf3c 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaTxGetHead.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaTxGetHead.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.ds.criteria;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.orcs.core.ds.Criteria;
/**
@@ -17,20 +18,20 @@ import org.eclipse.osee.orcs.core.ds.Criteria;
*/
public class CriteriaTxGetHead extends Criteria implements TxCriteria {
- private final long branchUuid;
+ private final BranchId branch;
- public CriteriaTxGetHead(long branchUuid) {
+ public CriteriaTxGetHead(BranchId branch) {
super();
- this.branchUuid = branchUuid;
+ this.branch = branch;
}
- public long getBranchid() {
- return branchUuid;
+ public BranchId getBranch() {
+ return branch;
}
@Override
public String toString() {
- return "CriteriaTxGetHead [branchUuid=" + branchUuid + "]";
+ return "CriteriaTxGetHead [branchUuid=" + branch + "]";
}
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/OrcsApiImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/OrcsApiImpl.java
index d802cc9abb0..98832facbd4 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/OrcsApiImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/OrcsApiImpl.java
@@ -199,7 +199,7 @@ public class OrcsApiImpl implements OrcsApi {
GraphProvider graphProvider = new GraphProvider() {
@Override
- public GraphData getGraph(OrcsSession session, Long branch, TransactionId transactionId) throws OseeCoreException {
+ public GraphData getGraph(OrcsSession session, BranchId branch, TransactionId transactionId) throws OseeCoreException {
return graphFactory.createGraph(session, branch, transactionId);
}
};
@@ -209,7 +209,7 @@ public class OrcsApiImpl implements OrcsApi {
TransactionProvider txProvider = new TransactionProvider() {
@Override
- public TransactionId getHeadTransaction(OrcsSession session, Long branch) {
+ public TransactionId getHeadTransaction(OrcsSession session, BranchId branch) {
QueryFactory queryFactory = queryModule.createQueryFactory(session);
return queryFactory.transactionQuery().andIsHead(branch).getResults().getExactlyOne();
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactory.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactory.java
index 9b4488182e2..8283e5bd8ec 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactory.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactFactory.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.orcs.core.internal.artifact;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
@@ -47,21 +48,21 @@ public class ArtifactFactory {
return new ArtifactImpl(artifactTypeCache, artifactData, attributeFactory);
}
- public Artifact createArtifact(OrcsSession session, Long branch, IArtifactType artifactType, String guid) throws OseeCoreException {
+ public Artifact createArtifact(OrcsSession session, BranchId branch, IArtifactType artifactType, String guid) throws OseeCoreException {
ArtifactData artifactData = factory.create(branch, artifactType, guid);
Artifact artifact = createArtifact(session, artifactData);
artifact.setLoaded(true);
return artifact;
}
- public Artifact createArtifact(OrcsSession session, Long branch, IArtifactType artifactType, String guid, long uuid) throws OseeCoreException {
+ public Artifact createArtifact(OrcsSession session, BranchId branch, IArtifactType artifactType, String guid, long uuid) throws OseeCoreException {
ArtifactData artifactData = factory.create(branch, artifactType, guid, uuid);
Artifact artifact = createArtifact(session, artifactData);
artifact.setLoaded(true);
return artifact;
}
- public Artifact copyArtifact(OrcsSession session, Artifact source, Collection<? extends IAttributeType> types, Long ontoBranch) throws OseeCoreException {
+ public Artifact copyArtifact(OrcsSession session, Artifact source, Collection<? extends IAttributeType> types, BranchId ontoBranch) throws OseeCoreException {
ArtifactData artifactData = factory.copy(ontoBranch, source.getOrcsData());
Artifact copy = createArtifact(session, artifactData);
Collection<? extends IAttributeType> typesToCopy = getAllowedTypes(copy, types);
@@ -75,14 +76,14 @@ public class ArtifactFactory {
return copy;
}
- public Artifact introduceArtifact(OrcsSession session, Artifact source, Artifact destination, Long ontoBranch) throws OseeCoreException {
+ public Artifact introduceArtifact(OrcsSession session, Artifact source, Artifact destination, BranchId ontoBranch) throws OseeCoreException {
destination = processIntroduceArtifact(session, source, destination, ontoBranch);
processIntroduceAttributes(source, destination, ontoBranch);
destination.setLoaded(true);
return destination;
}
- private void processIntroduceAttributes(Artifact source, Artifact destination, Long ontoBranch) {
+ private void processIntroduceAttributes(Artifact source, Artifact destination, BranchId ontoBranch) {
Collection<Attribute<Object>> introduceAttributes = source.getAttributes(DeletionFlag.INCLUDE_DELETED);
removeAttributes(source, destination);
//introduce the existing attributes
@@ -93,7 +94,7 @@ public class ArtifactFactory {
}
}
- private Artifact processIntroduceArtifact(OrcsSession session, Artifact source, Artifact destination, Long ontoBranch) {
+ private Artifact processIntroduceArtifact(OrcsSession session, Artifact source, Artifact destination, BranchId ontoBranch) {
ArtifactData artifactData = factory.introduce(ontoBranch, source.getOrcsData());
destination.setOrcsData(artifactData);
return destination;
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java
index 1420477d856..0e314cedc28 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.orcs.core.internal.artifact;
import static org.eclipse.osee.framework.core.enums.DirtyState.APPLICABILITY_ONLY;
import java.util.Collection;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.TransactionId;
@@ -93,8 +94,8 @@ public class ArtifactImpl extends AttributeManagerImpl implements Artifact {
}
@Override
- public Long getBranchId() {
- return artifactData.getVersion().getBranchId();
+ public BranchId getBranch() {
+ return artifactData.getVersion().getBranch();
}
@Override
@@ -156,7 +157,7 @@ public class ArtifactImpl extends AttributeManagerImpl implements Artifact {
@Override
public String getExceptionString() {
try {
- return String.format("artifact type[%s] guid[%s] on branch[%s]", getArtifactType(), getGuid(), getBranchId());
+ return String.format("artifact type[%s] guid[%s] on branch[%s]", getArtifactType(), getGuid(), getBranch());
} catch (OseeCoreException ex) {
return Lib.exceptionToString(ex);
}
@@ -209,8 +210,7 @@ public class ArtifactImpl extends AttributeManagerImpl implements Artifact {
@Override
public String toString() {
try {
- return String.format("artifact [type=[%s] guid=[%s] branch=[%s]]", getArtifactType(), getGuid(),
- getBranchId());
+ return String.format("artifact [type=[%s] guid=[%s] branch=[%s]]", getArtifactType(), getGuid(), getBranch());
} catch (OseeCoreException ex) {
return Lib.exceptionToString(ex);
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactory.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactory.java
index 49a4044ca4b..d90b4d8e9ae 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactory.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeFactory.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.orcs.core.internal.attribute;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.core.exception.AttributeDoesNotExist;
@@ -66,7 +67,7 @@ public class AttributeFactory {
return attribute;
}
- public <T> Attribute<T> copyAttribute(AttributeData source, Long ontoBranch, AttributeContainer destinationContainer) throws OseeCoreException {
+ public <T> Attribute<T> copyAttribute(AttributeData source, BranchId ontoBranch, AttributeContainer destinationContainer) throws OseeCoreException {
AttributeData attributeData = dataFactory.copy(ontoBranch, source);
return createAttribute(destinationContainer, attributeData, true, false);
}
@@ -77,7 +78,7 @@ public class AttributeFactory {
return destinationAttribute;
}
- public <T> Attribute<Object> introduceAttribute(AttributeData source, Long ontoBranch, AttributeManager destination) throws OseeCoreException {
+ public <T> Attribute<Object> introduceAttribute(AttributeData source, BranchId ontoBranch, AttributeManager destination) throws OseeCoreException {
AttributeData attributeData = dataFactory.introduce(ontoBranch, source);
// In order to reflect attributes they must exist in the data store
Attribute<Object> destinationAttribute = null;
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/BranchDataFactory.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/BranchDataFactory.java
index 8e8c3ce0fb3..f152e2cc6c5 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/BranchDataFactory.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/BranchDataFactory.java
@@ -73,12 +73,8 @@ public class BranchDataFactory {
}
private CreateBranchData createBranchData(IOseeBranch branch, BranchId parent, BranchType branchType, String creationComment, TransactionId sysRootHeadTx, ArtifactId author, ArtifactId associatedArtifact, boolean bCopyTx) {
- CreateBranchData createData = new CreateBranchData();
- createData.setUuid(branch.getUuid());
+ CreateBranchData createData = new CreateBranchData(branch);
createData.setName(branch.getName());
- if (branch.getUuid() > 0) {
- createData.setUuid(branch.getUuid());
- }
createData.setBranchType(branchType);
createData.setCreationComment(creationComment);
createData.setFromTransaction(sysRootHeadTx);
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/CreateBranchCallable.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/CreateBranchCallable.java
index 892b362bca8..346d344a9f1 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/CreateBranchCallable.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/CreateBranchCallable.java
@@ -35,7 +35,7 @@ public class CreateBranchCallable extends AbstractBranchCallable<BranchReadable>
protected BranchReadable innerCall() throws Exception {
Conditions.checkNotNull(branchData, "branchData");
- Conditions.checkNotNull(branchData.getUuid(), "branchUuid");
+ Conditions.checkNotNull(branchData.getBranch(), "branchUuid");
Conditions.checkNotNull(branchData.getName(), "branchName");
Conditions.checkNotNull(branchData.getBranchType(), "branchType");
@@ -54,6 +54,6 @@ public class CreateBranchCallable extends AbstractBranchCallable<BranchReadable>
getBranchStore().createBranch(branchData);
}
- return queryFactory.branchQuery().andUuids(branchData.getUuid()).getResults().getExactlyOne();
+ return queryFactory.branchQuery().andIds(branchData.getBranch()).getResults().getExactlyOne();
}
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/GraphFactory.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/GraphFactory.java
index 9903fc46c76..815da0ab587 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/GraphFactory.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/GraphFactory.java
@@ -10,7 +10,9 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.internal.graph;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.TransactionId;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.orcs.OrcsSession;
@@ -19,6 +21,6 @@ import org.eclipse.osee.orcs.OrcsSession;
*/
public interface GraphFactory {
- GraphData createGraph(OrcsSession session, Long branch, TransactionId transactionId) throws OseeCoreException;
+ GraphData createGraph(OrcsSession session, BranchId branch, TransactionId transactionId) throws OseeCoreException;
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/GraphProvider.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/GraphProvider.java
index bb65ffb9bfb..0d8f99c5f11 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/GraphProvider.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/GraphProvider.java
@@ -10,7 +10,9 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.internal.graph;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.TransactionId;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.orcs.OrcsSession;
@@ -19,6 +21,6 @@ import org.eclipse.osee.orcs.OrcsSession;
*/
public interface GraphProvider {
- GraphData getGraph(OrcsSession session, Long branch, TransactionId transactionId) throws OseeCoreException;
+ GraphData getGraph(OrcsSession session, BranchId branch, TransactionId transactionId) throws OseeCoreException;
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/GraphUtil.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/GraphUtil.java
index dea861ea854..eddc30d5e83 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/GraphUtil.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/GraphUtil.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.internal.graph;
-import com.google.common.base.Objects;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
@@ -29,16 +29,14 @@ public final class GraphUtil {
return new GraphProvider() {
@Override
- public GraphData getGraph(OrcsSession session, Long branchId, TransactionId transactionId) throws OseeCoreException {
- Conditions.checkExpressionFailOnTrue(!Objects.equal(graph.getBranchId(), branchId),
- "Invalid branch - Graph's branch[%s] does not equals requested branch[%s]", graph.getBranchId(),
- branchId);
- Conditions.checkExpressionFailOnTrue(!Objects.equal(graph.getTransaction(), transactionId),
+ public GraphData getGraph(OrcsSession session, BranchId branch, TransactionId transactionId) throws OseeCoreException {
+ Conditions.assertTrue(graph.getBranch().equals(branch),
+ "Invalid branch - Graph's branch[%s] does not equals requested branch[%s]", graph.getBranch(), branch);
+ Conditions.assertTrue(graph.getTransaction().equals(transactionId),
"Invalid transactionId - Graph's transactionId[%s] does not equals requested transactionId[%s]",
graph.getTransaction(), transactionId);
return graph;
}
};
}
-
-}
+} \ No newline at end of file
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 9717b80356e..97edd2ace1e 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
@@ -67,7 +67,7 @@ public class GraphBuilderImpl extends LoadDataHandlerAdapter implements GraphBui
@Override
public void onLoadDescription(LoadDescription data) throws OseeCoreException {
- graph = graphProvider.getGraph(data.getSession(), data.getBranchId(), data.getTransaction());
+ graph = graphProvider.getGraph(data.getSession(), data.getBranch(), data.getTransaction());
Conditions.checkNotNull(graph, "graph");
};
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphDataImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphDataImpl.java
index a543235f3bb..28be47cc1b1 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphDataImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphDataImpl.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.orcs.core.internal.graph.impl;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.HasLocalId;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
@@ -29,14 +30,14 @@ public class GraphDataImpl implements GraphData {
private final Map<Integer, GraphNode> nodesById = new ConcurrentHashMap<>();
private final Map<Integer, GraphAdjacencies> adjacenciesById = new ConcurrentHashMap<>();
- private final Long branchId;
+ private final BranchId branch;
private final TransactionId txId;
private final OrcsSession orcsSession;
- public GraphDataImpl(OrcsSession session, Long branchId, TransactionId txId) {
+ public GraphDataImpl(OrcsSession session, BranchId branch, TransactionId txId) {
super();
this.orcsSession = session;
- this.branchId = branchId;
+ this.branch = branch;
this.txId = txId;
}
@@ -58,7 +59,7 @@ public class GraphDataImpl implements GraphData {
@Override
public void addNode(GraphNode node, boolean useBackingData) throws OseeCoreException {
- boolean sameBranches = getBranchId().equals(node.getBranchId());
+ boolean sameBranches = getBranch().equals(node.getBranch());
if (!sameBranches) {
throw new OseeArgumentException("Invalid node added to graph. Graph[%s] Node[%s]", this,
node.getExceptionString());
@@ -121,14 +122,14 @@ public class GraphDataImpl implements GraphData {
@Override
public String toString() {
- return String.format("Graph - branch[%s] txId[%s] nodes[%s] adjacencies[%s]", getBranchId(), getTransaction(),
+ return String.format("Graph - branch[%s] txId[%s] nodes[%s] adjacencies[%s]", getBranch(), getTransaction(),
nodesById.size(), adjacenciesById.size());
}
@Override
public int hashCode() {
final int prime = 31;
- int result = getBranchId().hashCode();
+ int result = getBranch().hashCode();
result = prime * result + getTransaction().hashCode();
return result;
}
@@ -142,7 +143,7 @@ public class GraphDataImpl implements GraphData {
return false;
}
GraphData other = (GraphData) obj;
- if (!getBranchId().equals(other.getBranchId())) {
+ if (!getBranch().equals(other.getBranch())) {
return false;
}
if (getTransaction() != other.getTransaction()) {
@@ -157,7 +158,7 @@ public class GraphDataImpl implements GraphData {
}
@Override
- public Long getBranchId() {
- return branchId;
+ public BranchId getBranch() {
+ return branch;
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphFactoryImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphFactoryImpl.java
index b9ea4972c01..1db3394b578 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphFactoryImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphFactoryImpl.java
@@ -10,7 +10,9 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.internal.graph.impl;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.TransactionId;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.internal.graph.GraphData;
import org.eclipse.osee.orcs.core.internal.graph.GraphFactory;
@@ -21,7 +23,7 @@ import org.eclipse.osee.orcs.core.internal.graph.GraphFactory;
public class GraphFactoryImpl implements GraphFactory {
@Override
- public GraphData createGraph(OrcsSession session, Long branch, TransactionId transactionId) {
+ public GraphData createGraph(OrcsSession session, BranchId branch, TransactionId transactionId) {
return new GraphDataImpl(session, branch, transactionId);
}
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 d09e65327a2..1d3d25df2c6 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
@@ -16,6 +16,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IRelationType;
@@ -75,8 +76,8 @@ public class ArtifactReadOnlyImpl extends AbstractProxied<Artifact> implements A
}
@Override
- public Long getBranchId() {
- return getProxiedObject().getBranchId();
+ public BranchId getBranch() {
+ return getProxiedObject().getBranch();
}
@Override
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationFactory.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationFactory.java
index ed524ce589e..fddc23aacfb 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationFactory.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationFactory.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.internal.relation;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.orcs.core.ds.RelationData;
@@ -42,7 +43,7 @@ public class RelationFactory {
public Relation createRelation(RelationNode aNode, IRelationType type, RelationNode bNode) throws OseeCoreException {
OrcsConditions.checkBranch(aNode, bNode);
OrcsConditions.checkRelateSelf(aNode, bNode);
- RelationData data = relationDataFactory.createRelationData(type, aNode.getBranchId(), aNode, bNode, "");
+ RelationData data = relationDataFactory.createRelationData(type, aNode.getBranch(), aNode, bNode, "");
return createRelation(data);
}
@@ -51,10 +52,8 @@ public class RelationFactory {
return createRelation(data);
}
- public Relation introduce(Long branch, RelationData data) {
+ public Relation introduce(BranchId branch, RelationData data) {
RelationData source = relationDataFactory.introduce(branch, data);
-
return createRelation(source);
}
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationManager.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationManager.java
index ce55e2ee7d3..4a971573bf8 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationManager.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationManager.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.orcs.core.internal.relation;
import java.util.Collection;
import java.util.List;
import org.eclipse.osee.framework.core.data.ApplicabilityId;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IRelationSorterId;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
@@ -85,7 +86,7 @@ public interface RelationManager {
void cloneRelations(OrcsSession session, RelationNode source, RelationNode destination) throws OseeCoreException;
- void introduce(OrcsSession session, Long branch, RelationNode source, RelationNode destination) throws OseeCoreException;
+ void introduce(OrcsSession session, BranchId branch, RelationNode source, RelationNode destination) throws OseeCoreException;
void setApplicabilityId(OrcsSession session, RelationNode aNode, IRelationType type, RelationNode bNode, ApplicabilityId applicId);
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java
index 65741a7bb70..5c306898825 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java
@@ -32,7 +32,9 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.ApplicabilityId;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IRelationSorterId;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.data.IRelationTypeSide;
@@ -472,7 +474,7 @@ public class RelationManagerImpl implements RelationManager {
}
@Override
- public void introduce(OrcsSession session, Long branch, RelationNode source, RelationNode destination) throws OseeCoreException {
+ public void introduce(OrcsSession session, BranchId branch, RelationNode source, RelationNode destination) throws OseeCoreException {
ensureRelationsInitialized(session, source.getGraph(), source);
Collection<? extends IRelationType> validRelationTypes = getValidRelationTypes(session, destination);
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeLoaderImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeLoaderImpl.java
index 2fd4abfbcec..4600d577af4 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeLoaderImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeLoaderImpl.java
@@ -40,7 +40,7 @@ public class RelationNodeLoaderImpl implements RelationNodeLoader {
public <T extends RelationNode> Iterable<T> loadNodes(OrcsSession session, final GraphData graph, Collection<Integer> ids, LoadLevel level) throws OseeCoreException {
GraphBuilder builder = graphBuilderFactory.createBuilderForGraph(graph);
- DataLoader loader = dataLoaderFactory.newDataLoaderFromIds(session, graph.getBranchId(), ids);
+ DataLoader loader = dataLoaderFactory.newDataLoaderFromIds(session, graph.getBranch(), ids);
loader.withLoadLevel(level);
loader.fromTransaction(graph.getTransaction());
loader.includeDeletedArtifacts();
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/script/impl/OrcsScriptInterpreterImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/script/impl/OrcsScriptInterpreterImpl.java
index 651ebe016d5..e7f2b4b4c6b 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/script/impl/OrcsScriptInterpreterImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/script/impl/OrcsScriptInterpreterImpl.java
@@ -439,7 +439,7 @@ public class OrcsScriptInterpreterImpl implements OrcsScriptInterpreter {
@Override
public Void caseOsTxHeadOfBranchIdCriteria(OsTxHeadOfBranchIdCriteria object) {
Long id = resolver.resolveSingle(Long.class, object.getId());
- getTxQuery().andIsHead(id);
+ getTxQuery().andIsHead(TokenFactory.createBranch(id));
return null;
}
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 e99c0f79820..6da1ea96bca 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
@@ -54,8 +54,8 @@ public class BranchCriteriaFactory {
return new CriteriaBranchArchived(states);
}
- public Criteria createMergeForCriteria(Long sourceUuid, Long destUuid) {
- return new CriteriaMergeBranchFor(sourceUuid, destUuid);
+ public Criteria createMergeForCriteria(BranchId source, BranchId destination) {
+ return new CriteriaMergeBranchFor(source, destination);
}
public Criteria createAssociatedArtIdCriteria(int artId) {
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 f4d97599db1..079ab3928e3 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
@@ -165,8 +165,8 @@ public class BranchQueryBuilderImpl<T> implements BranchQueryBuilder<T> {
}
@Override
- public T andIsMergeFor(Long sourceUuid, Long destUuid) {
- Criteria criteria = criteriaFactory.createMergeForCriteria(sourceUuid, destUuid);
+ public T andIsMergeFor(BranchId source, BranchId destination) {
+ Criteria criteria = criteriaFactory.createMergeForCriteria(source, destination);
return addAndCheck(getQueryData(), criteria);
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/QueryFactoryImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/QueryFactoryImpl.java
index ec2fffda441..96d047154f7 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/QueryFactoryImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/QueryFactoryImpl.java
@@ -59,7 +59,7 @@ public class QueryFactoryImpl implements QueryFactory {
this.tupleQuery = tupleQuery;
}
- private QueryBuilder createBuilder(Long branchId) {
+ private QueryBuilder createBuilder(BranchId branchId) {
Options options = OptionsUtil.createOptions();
CriteriaSet criteriaSet = new CriteriaSet();
if (branchId != null) {
@@ -81,13 +81,12 @@ public class QueryFactoryImpl implements QueryFactory {
@Override
public QueryBuilder fromBranch(BranchId branch) throws OseeCoreException {
- Conditions.checkNotNull(branch, "branch");
- return fromBranch(branch.getUuid());
+ return createBuilder(branch);
}
@Override
public QueryBuilder fromBranch(Long branchId) throws OseeCoreException {
- return createBuilder(branchId);
+ return fromBranch(BranchId.valueOf(branchId));
}
@Override
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/TransactionCriteriaFactory.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/TransactionCriteriaFactory.java
index 8756751e0df..b0073141ed8 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/TransactionCriteriaFactory.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/TransactionCriteriaFactory.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.orcs.core.internal.search;
import java.sql.Timestamp;
import java.util.Collection;
import org.eclipse.osee.framework.core.data.TransactionId;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
import org.eclipse.osee.orcs.core.ds.Criteria;
import org.eclipse.osee.orcs.core.ds.criteria.CriteriaAllTxs;
@@ -79,8 +80,8 @@ public class TransactionCriteriaFactory {
return new CriteriaCommitIds(ids);
}
- public Criteria newGetHead(long branchUuid) {
- return new CriteriaTxGetHead(branchUuid);
+ public Criteria newGetHead(BranchId branch) {
+ return new CriteriaTxGetHead(branch);
}
public Criteria newGetPriorTx(TransactionId txId) {
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/TxQueryBuilderImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/TxQueryBuilderImpl.java
index b266fe24962..130caeac377 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/TxQueryBuilderImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/TxQueryBuilderImpl.java
@@ -185,13 +185,8 @@ public class TxQueryBuilderImpl<T> implements TxQueryBuilder<T> {
}
@Override
- public T andIsHead(BranchId branch) throws OseeCoreException {
- return andIsHead(branch.getUuid());
- }
-
- @Override
- public T andIsHead(long branchUuid) throws OseeCoreException {
- Criteria criteria = criteriaFactory.newGetHead(branchUuid);
+ public T andIsHead(BranchId branch) {
+ Criteria criteria = criteriaFactory.newGetHead(branch);
return addAndCheck(queryData, criteria);
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImpl.java
index 507a35d01c9..b7f8efa2cee 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImpl.java
@@ -68,8 +68,8 @@ public class TransactionBuilderImpl implements TransactionBuilder {
}
@Override
- public Long getBranchId() {
- return txData.getBranchId();
+ public BranchId getBranch() {
+ return txData.getBranch();
}
@Override
@@ -104,52 +104,43 @@ public class TransactionBuilderImpl implements TransactionBuilder {
@Override
public ArtifactId createArtifact(IArtifactToken token) throws OseeCoreException {
- Conditions.checkExpressionFailOnTrue(token.getUuid() <= 0L, "Invalid Uuid %d. Must be > 0", token.getUuid());
- return txManager.createArtifact(txData, token.getArtifactType(), token.getName(), token.getGuid(),
- token.getUuid());
+ Conditions.checkExpressionFailOnTrue(token.isInvalid(), "Invalid Id %d. Must be > 0", token.getId());
+ return txManager.createArtifact(txData, token.getArtifactType(), token.getName(), token.getGuid(), token.getId());
}
@Override
public ArtifactId copyArtifact(ArtifactReadable sourceArtifact) throws OseeCoreException {
- return copyArtifact(sourceArtifact.getBranchId(), sourceArtifact);
+ return copyArtifact(sourceArtifact.getBranch(), sourceArtifact);
}
@Override
public ArtifactId copyArtifact(BranchId fromBranch, ArtifactId artifactId) throws OseeCoreException {
- return copyArtifact(fromBranch.getUuid(), artifactId);
- }
-
- private ArtifactId copyArtifact(Long fromBranchId, ArtifactId artifactId) throws OseeCoreException {
- return txManager.copyArtifact(txData, fromBranchId, artifactId);
+ return txManager.copyArtifact(txData, fromBranch, artifactId);
}
@Override
public ArtifactId copyArtifact(ArtifactReadable sourceArtifact, Collection<? extends IAttributeType> attributesToDuplicate) throws OseeCoreException {
- return copyArtifact(sourceArtifact.getBranchId(), sourceArtifact, attributesToDuplicate);
+ return copyArtifact(sourceArtifact.getBranch(), sourceArtifact, attributesToDuplicate);
}
@Override
public ArtifactId copyArtifact(BranchId fromBranch, ArtifactId artifactId, Collection<? extends IAttributeType> attributesToDuplicate) throws OseeCoreException {
- return copyArtifact(fromBranch.getUuid(), artifactId, attributesToDuplicate);
- }
-
- private ArtifactId copyArtifact(Long fromBranch, ArtifactId artifactId, Collection<? extends IAttributeType> attributesToDuplicate) throws OseeCoreException {
return txManager.copyArtifact(txData, fromBranch, artifactId, attributesToDuplicate);
}
@Override
public ArtifactId introduceArtifact(BranchId fromBranch, ArtifactId sourceArtifact) throws OseeCoreException {
- checkAreOnDifferentBranches(txData, fromBranch.getUuid());
- ArtifactReadable source = getArtifactReadable(txData.getSession(), query, fromBranch.getUuid(), sourceArtifact);
+ checkAreOnDifferentBranches(txData, fromBranch);
+ ArtifactReadable source = getArtifactReadable(txData.getSession(), query, fromBranch, sourceArtifact);
Conditions.checkNotNull(source, "Source Artifact");
ArtifactReadable destination =
- getArtifactReadable(txData.getSession(), query, txData.getBranchId(), sourceArtifact);
- return txManager.introduceArtifact(txData, fromBranch.getUuid(), source, destination);
+ getArtifactReadable(txData.getSession(), query, txData.getBranch(), sourceArtifact);
+ return txManager.introduceArtifact(txData, fromBranch, source, destination);
}
@Override
public ArtifactId replaceWithVersion(ArtifactReadable sourceArtifact, ArtifactReadable destination) throws OseeCoreException {
- return txManager.replaceWithVersion(txData, sourceArtifact.getBranchId(), sourceArtifact, destination);
+ return txManager.replaceWithVersion(txData, sourceArtifact.getBranch(), sourceArtifact, destination);
}
@Override
@@ -347,13 +338,13 @@ public class TransactionBuilderImpl implements TransactionBuilder {
}
}
- private void checkAreOnDifferentBranches(TxData txData, Long sourceBranch) throws OseeCoreException {
+ private void checkAreOnDifferentBranches(TxData txData, BranchId sourceBranch) throws OseeCoreException {
boolean isOnSameBranch = txData.isOnBranch(sourceBranch);
Conditions.checkExpressionFailOnTrue(isOnSameBranch, "Source branch is same branch as transaction branch[%s]",
- txData.getBranchId());
+ txData.getBranch());
}
- protected ArtifactReadable getArtifactReadable(OrcsSession session, QueryModule query, Long branch, ArtifactId id) {
+ protected ArtifactReadable getArtifactReadable(OrcsSession session, QueryModule query, BranchId branch, ArtifactId id) {
return query.createQueryFactory(session).fromBranch(branch).includeDeletedArtifacts().andId(
id).getResults().getOneOrNull();
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionFactoryImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionFactoryImpl.java
index 43d7be00e5d..92a581e6c2f 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionFactoryImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionFactoryImpl.java
@@ -10,6 +10,9 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.internal.transaction;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+import com.google.common.collect.Sets.SetView;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
@@ -38,9 +41,6 @@ import org.eclipse.osee.orcs.data.TransactionReadable;
import org.eclipse.osee.orcs.search.QueryFactory;
import org.eclipse.osee.orcs.transaction.TransactionBuilder;
import org.eclipse.osee.orcs.transaction.TransactionFactory;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-import com.google.common.collect.Sets.SetView;
/**
* @author Roberto E. Escobar
@@ -64,8 +64,8 @@ public class TransactionFactoryImpl implements TransactionFactory {
this.query = query;
this.queryFactory = queryFactory;
this.orcsBranch = orcsBranch;
- this.keyValueOps = keyValueOps;
- this.txDataStore = txDataStore;
+ this.keyValueOps = keyValueOps;
+ this.txDataStore = txDataStore;
}
@Override
@@ -85,7 +85,7 @@ public class TransactionFactoryImpl implements TransactionFactory {
Conditions.checkNotNull(author, "author");
Conditions.checkNotNullOrEmpty(comment, "comment");
- TxData txData = txDataManager.createTxData(session, branch.getUuid());
+ TxData txData = txDataManager.createTxData(session, branch);
TransactionBuilderImpl orcsTxn =
new TransactionBuilderImpl(txCallableFactory, txDataManager, txData, query, keyValueOps);
orcsTxn.setComment(comment);
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxData.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxData.java
index 9ea3d7d25ab..bb95c59fa9a 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxData.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxData.java
@@ -15,6 +15,7 @@ import java.util.HashSet;
import java.util.Map;
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.data.HasBranch;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.ds.TupleData;
@@ -66,8 +67,8 @@ public class TxData implements HasSession, HasBranch {
}
@Override
- public Long getBranchId() {
- return graph.getBranchId();
+ public BranchId getBranch() {
+ return graph.getBranch();
}
public GraphData getGraph() {
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataLoaderImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataLoaderImpl.java
index cc25b847e0f..0f551f49bc0 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataLoaderImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataLoaderImpl.java
@@ -14,7 +14,9 @@ import java.util.Collection;
import java.util.LinkedHashSet;
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.data.TransactionId;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.LoadLevel;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
@@ -43,7 +45,7 @@ public class TxDataLoaderImpl implements TxDataLoader {
private final TransactionProvider txProvider;
public static interface TransactionProvider {
- TransactionId getHeadTransaction(OrcsSession session, Long branch);
+ TransactionId getHeadTransaction(OrcsSession session, BranchId branch);
}
public TxDataLoaderImpl(DataLoaderFactory dataLoaderFactory, GraphFactory graphFactory, GraphBuilderFactory graphBuilderFactory, GraphProvider graphProvider, TransactionProvider txProvider) {
@@ -55,12 +57,12 @@ public class TxDataLoaderImpl implements TxDataLoader {
this.txProvider = txProvider;
}
- private DataLoader createLoader(OrcsSession session, Long branchId, Collection<ArtifactId> artifactIds) throws OseeCoreException {
+ private DataLoader createLoader(OrcsSession session, BranchId branch, Collection<ArtifactId> artifactIds) throws OseeCoreException {
Set<Integer> ids = new LinkedHashSet<>();
for (ArtifactId artifactId : artifactIds) {
ids.add(artifactId.getUuid().intValue());
}
- DataLoader loader = dataLoaderFactory.newDataLoaderFromIds(session, branchId, ids);
+ DataLoader loader = dataLoaderFactory.newDataLoaderFromIds(session, branch, ids);
loader.withLoadLevel(LoadLevel.ALL);
loader.includeDeletedAttributes();
loader.includeDeletedRelations();
@@ -68,8 +70,8 @@ public class TxDataLoaderImpl implements TxDataLoader {
}
@Override
- public ResultSet<Artifact> loadArtifacts(OrcsSession session, Long branchId, Collection<ArtifactId> artifactIds) throws OseeCoreException {
- DataLoader loader = createLoader(session, branchId, artifactIds);
+ public ResultSet<Artifact> loadArtifacts(OrcsSession session, BranchId branch, Collection<ArtifactId> artifactIds) throws OseeCoreException {
+ DataLoader loader = createLoader(session, branch, artifactIds);
GraphBuilder handler = graphBuilderFactory.createGraphBuilder(graphProvider);
loader.load(null, handler);
return ResultSets.newResultSet(handler.getArtifacts());
@@ -77,7 +79,7 @@ public class TxDataLoaderImpl implements TxDataLoader {
@Override
public ResultSet<Artifact> loadArtifacts(OrcsSession session, GraphData graph, Collection<ArtifactId> artifactIds) throws OseeCoreException {
- DataLoader loader = createLoader(session, graph.getBranchId(), artifactIds);
+ DataLoader loader = createLoader(session, graph.getBranch(), artifactIds);
loader.fromTransaction(graph.getTransaction());
GraphBuilder handler = graphBuilderFactory.createBuilderForGraph(graph);
loader.load(null, handler);
@@ -85,7 +87,7 @@ public class TxDataLoaderImpl implements TxDataLoader {
}
@Override
- public GraphData createGraph(OrcsSession session, Long branch) throws OseeCoreException {
+ public GraphData createGraph(OrcsSession session, BranchId branch) throws OseeCoreException {
TransactionId headTransaction = txProvider.getHeadTransaction(session, branch);
return graphFactory.createGraph(session, branch, headTransaction);
}
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 eb3232c228d..ee36031c717 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
@@ -55,9 +55,9 @@ public class TxDataManager {
public interface TxDataLoader {
- GraphData createGraph(OrcsSession session, Long branch) throws OseeCoreException;
+ GraphData createGraph(OrcsSession session, BranchId branch) throws OseeCoreException;
- ResultSet<Artifact> loadArtifacts(OrcsSession session, Long branchId, Collection<ArtifactId> artifactIds) throws OseeCoreException;
+ ResultSet<Artifact> loadArtifacts(OrcsSession session, BranchId branch, Collection<ArtifactId> artifactIds) throws OseeCoreException;
ResultSet<Artifact> loadArtifacts(OrcsSession session, GraphData graph, Collection<ArtifactId> singleton) throws OseeCoreException;
@@ -77,7 +77,7 @@ public class TxDataManager {
this.tupleManager = tupleManager;
}
- public TxData createTxData(OrcsSession session, Long branch) throws OseeCoreException {
+ public TxData createTxData(OrcsSession session, BranchId branch) throws OseeCoreException {
GraphData graphData = loader.createGraph(session, branch);
return new TxData(session, graphData);
}
@@ -184,9 +184,9 @@ public class TxDataManager {
return artifact;
}
- private Artifact getSourceArtifact(TxData txData, Long fromBranchId, ArtifactId artifactId) throws OseeCoreException {
+ private Artifact getSourceArtifact(TxData txData, BranchId fromBranch, ArtifactId artifactId) throws OseeCoreException {
Artifact source = null;
- if (txData.isOnBranch(fromBranchId)) {
+ if (txData.isOnBranch(fromBranch)) {
source = txData.getWriteable(artifactId);
}
@@ -194,12 +194,12 @@ public class TxDataManager {
Artifact artifactSrc = null;
if (artifactId instanceof Artifact) {
Artifact external = (Artifact) artifactId;
- if (fromBranchId.equals(external.getBranchId())) {
+ if (fromBranch.equals(external.getBranch())) {
artifactSrc = external;
}
} else if (artifactId instanceof ArtifactReadable) {
ArtifactReadable external = (ArtifactReadable) artifactId;
- if (fromBranchId.equals(external.getBranchId())) {
+ if (fromBranch.equals(external.getBranch())) {
artifactSrc = proxyManager.asInternalArtifact(external);
}
}
@@ -210,7 +210,7 @@ public class TxDataManager {
}
if (source == null) {
ResultSet<Artifact> loadArtifacts =
- loader.loadArtifacts(txData.getSession(), fromBranchId, singleton(artifactId));
+ loader.loadArtifacts(txData.getSession(), fromBranch, singleton(artifactId));
source = loadArtifacts.getExactlyOne();
}
return source;
@@ -250,7 +250,7 @@ public class TxDataManager {
public ArtifactReadable createArtifact(TxData txData, IArtifactType artifactType, String name, String guid) throws OseeCoreException {
checkChangesAllowed(txData);
- Artifact artifact = artifactFactory.createArtifact(txData.getSession(), txData.getBranchId(), artifactType, guid);
+ Artifact artifact = artifactFactory.createArtifact(txData.getSession(), txData.getBranch(), artifactType, guid);
artifact.setName(name);
return asExternalArtifact(txData, artifact);
}
@@ -258,48 +258,48 @@ public class TxDataManager {
public ArtifactReadable createArtifact(TxData txData, IArtifactType artifactType, String name, String guid, long uuid) throws OseeCoreException {
checkChangesAllowed(txData);
Artifact artifact =
- artifactFactory.createArtifact(txData.getSession(), txData.getBranchId(), artifactType, guid, uuid);
+ artifactFactory.createArtifact(txData.getSession(), txData.getBranch(), artifactType, guid, uuid);
artifact.setName(name);
return asExternalArtifact(txData, artifact);
}
- public ArtifactReadable copyArtifact(TxData txData, Long fromBranchId, ArtifactId artifactId) throws OseeCoreException {
+ public ArtifactReadable copyArtifact(TxData txData, BranchId fromBranch, ArtifactId artifactId) throws OseeCoreException {
checkChangesAllowed(txData);
- Artifact source = getSourceArtifact(txData, fromBranchId, artifactId);
+ Artifact source = getSourceArtifact(txData, fromBranch, artifactId);
return copyArtifactHelper(txData, source, source.getExistingAttributeTypes());
}
- public ArtifactReadable copyArtifact(TxData txData, Long fromBranchId, ArtifactId artifactId, Collection<? extends IAttributeType> attributesToDuplicate) throws OseeCoreException {
+ public ArtifactReadable copyArtifact(TxData txData, BranchId fromBranch, ArtifactId artifactId, Collection<? extends IAttributeType> attributesToDuplicate) throws OseeCoreException {
checkChangesAllowed(txData);
- Artifact source = getSourceArtifact(txData, fromBranchId, artifactId);
+ Artifact source = getSourceArtifact(txData, fromBranch, artifactId);
return copyArtifactHelper(txData, source, attributesToDuplicate);
}
private ArtifactReadable copyArtifactHelper(TxData txData, Artifact source, Collection<? extends IAttributeType> attributesToDuplicate) throws OseeCoreException {
Artifact copy =
- artifactFactory.copyArtifact(txData.getSession(), source, attributesToDuplicate, txData.getBranchId());
+ artifactFactory.copyArtifact(txData.getSession(), source, attributesToDuplicate, txData.getBranch());
return asExternalArtifact(txData, copy);
}
- public ArtifactReadable introduceArtifact(TxData txData, Long fromBranchId, ArtifactReadable source, ArtifactReadable destination) throws OseeCoreException {
+ public ArtifactReadable introduceArtifact(TxData txData, BranchId fromBranch, ArtifactReadable source, ArtifactReadable destination) throws OseeCoreException {
checkChangesAllowed(txData);
- Artifact src = getSourceArtifact(txData, fromBranchId, source);
+ Artifact src = getSourceArtifact(txData, fromBranch, source);
Artifact dest = null;
if (destination == null) {
- dest = artifactFactory.createArtifact(txData.getSession(), txData.getBranchId(), src.getArtifactType(),
+ dest = artifactFactory.createArtifact(txData.getSession(), txData.getBranch(), src.getArtifactType(),
src.getGuid());
- dest.setGraph(loader.createGraph(txData.getSession(), txData.getBranchId()));
+ dest.setGraph(loader.createGraph(txData.getSession(), txData.getBranch()));
} else {
- dest = getSourceArtifact(txData, fromBranchId, destination);
+ dest = getSourceArtifact(txData, fromBranch, destination);
}
- artifactFactory.introduceArtifact(txData.getSession(), src, dest, txData.getBranchId());
- relationManager.introduce(txData.getSession(), txData.getBranchId(), src, dest);
+ artifactFactory.introduceArtifact(txData.getSession(), src, dest, txData.getBranch());
+ relationManager.introduce(txData.getSession(), txData.getBranch(), src, dest);
addAdjacencies(txData, dest);
return asExternalArtifact(txData, dest);
}
- public ArtifactReadable replaceWithVersion(TxData txData, Long fromBranchId, ArtifactReadable readable, ArtifactReadable destination) throws OseeCoreException {
- return introduceArtifact(txData, fromBranchId, readable, destination);
+ public ArtifactReadable replaceWithVersion(TxData txData, BranchId fromBranch, ArtifactReadable readable, ArtifactReadable destination) throws OseeCoreException {
+ return introduceArtifact(txData, fromBranch, readable, destination);
}
private void addAdjacencies(TxData txData, Artifact dest) {
@@ -432,7 +432,7 @@ public class TxDataManager {
}
OrcsChangeSet changeSet = builder.getChangeSet();
- return new TransactionDataImpl(txData.getBranchId(), txData.getAuthor(), txData.getComment(), changeSet);
+ return new TransactionDataImpl(txData.getBranch(), txData.getAuthor(), txData.getComment(), changeSet);
}
public void setApplicabilityId(TxData txData, ArtifactId artId, ApplicabilityId applicId) {
@@ -442,22 +442,21 @@ public class TxDataManager {
private static final class TransactionDataImpl implements TransactionData {
- private final Long branchId;
+ private final BranchId branch;
private final ArtifactId author;
private final String comment;
private final OrcsChangeSet changeSet;
- public TransactionDataImpl(Long branchId, ArtifactId author, String comment, OrcsChangeSet changeSet) {
- super();
- this.branchId = branchId;
+ public TransactionDataImpl(BranchId branch, ArtifactId author, String comment, OrcsChangeSet changeSet) {
+ this.branch = branch;
this.author = author;
this.comment = comment;
this.changeSet = changeSet;
}
@Override
- public Long getBranchId() {
- return branchId;
+ public BranchId getBranch() {
+ return branch;
}
@Override
@@ -477,7 +476,7 @@ public class TxDataManager {
@Override
public String toString() {
- return "TransactionDataImpl [branch=" + branchId + ", author=" + author + ", comment=" + comment + ", changeSet=" + changeSet + "]";
+ return "TransactionDataImpl [branch=" + branch + ", author=" + author + ", comment=" + comment + ", changeSet=" + changeSet + "]";
}
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/BranchProvider.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/BranchProvider.java
deleted file mode 100644
index 42fa7187989..00000000000
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/BranchProvider.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.orcs.core.internal.util;
-
-import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.core.model.cache.BranchCache;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.orcs.core.ds.OrcsData;
-
-/**
- * @author Roberto E. Escobar
- */
-public class BranchProvider extends OrcsLazyObject<Branch, OrcsData> implements ValueProvider<Branch, OrcsData> {
-
- private final BranchCache branchCache;
-
- public BranchProvider(BranchCache branchCache, OrcsData data) {
- super(data);
- this.branchCache = branchCache;
- }
-
- @Override
- protected Branch instance() throws OseeCoreException {
- return branchCache.getById(getOrcsData().getVersion().getBranchId());
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsConditions.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsConditions.java
index 312a9b795b3..c25873c3bd4 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsConditions.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsConditions.java
@@ -41,13 +41,13 @@ public final class OrcsConditions {
checkNotNull(node, "node");
GraphData graph2 = node.getGraph();
checkExpressionFailOnTrue(!graph.getBranch().equals(graph2.getBranch()),
- "Error - Node[%s] is on branch[%d] but should be on branch[%d]", node, graph2.getBranchId(),
- graph.getBranchId());
+ "Error - Node[%s] is on branch[%d] but should be on branch[%d]", node, graph2.getBranch(),
+ graph.getBranch());
}
}
public static void checkBranch(RelationNode node1, RelationNode node2) throws OseeCoreException {
- boolean areEqual = node1.getBranchId().equals(node2.getBranchId());
+ boolean areEqual = node1.getBranch().equals(node2.getBranch());
checkExpressionFailOnTrue(!areEqual, "Cross branch linking is not yet supported.");
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/ValueProvider.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/ValueProvider.java
deleted file mode 100644
index eacd42d742b..00000000000
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/ValueProvider.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.orcs.core.internal.util;
-
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.orcs.core.ds.HasOrcsData;
-import org.eclipse.osee.orcs.core.ds.OrcsData;
-
-/**
- * @author Roberto E. Escobar
- */
-public interface ValueProvider<T, D extends OrcsData> extends HasOrcsData<D> {
-
- T get() throws OseeCoreException;
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/IntegrationUtil.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/IntegrationUtil.java
index e478e7f8b0b..8160b30a0f9 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/IntegrationUtil.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/IntegrationUtil.java
@@ -14,7 +14,6 @@ import static org.junit.Assert.assertEquals;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
-import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.orcs.core.ds.ArtifactData;
@@ -78,7 +77,7 @@ public class IntegrationUtil {
assertEquals(orcsData.getTypeUuid(), values[index++]);
VersionData version = orcsData.getVersion();
- assertEquals(version.getBranchId(), ((BranchId) values[index++]).getId());
+ assertEquals(version.getBranch(), values[index++]);
assertEquals(version.getTransactionId(), values[index++]);
assertEquals(version.getStripeId(), TransactionId.SENTINEL);
assertEquals(version.getGammaId(), values[index++]);
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 c3552a8fc1e..86807250530 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
@@ -16,7 +16,6 @@ import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.Active;
import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.Name;
import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.UriGeneralStringData;
import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
import static org.eclipse.osee.framework.core.enums.CoreRelationTypes.Default_Hierarchical__Parent;
import static org.eclipse.osee.framework.core.enums.ModificationType.NEW;
import static org.eclipse.osee.orcs.db.intergration.IntegrationUtil.integrationRule;
@@ -130,7 +129,7 @@ public class LoaderTest {
@org.junit.Test
public void testLoad() throws OseeCoreException {
DataLoader loader =
- loaderFactory.newDataLoaderFromIds(session, COMMON_ID, OseeTypesFrameworkId, OseeTypesDemoId, UserGroupsId);
+ loaderFactory.newDataLoaderFromIds(session, COMMON, OseeTypesFrameworkId, OseeTypesDemoId, UserGroupsId);
loader.withLoadLevel(LoadLevel.ALL);
verifyArtsAttrAndRelData(loader);
}
@@ -144,7 +143,7 @@ public class LoaderTest {
verify(builder).onLoadEnd();
LoadDescription descriptor = descriptorCaptor.getValue();
- assertEquals(COMMON_ID, descriptor.getBranchId());
+ assertEquals(COMMON, descriptor.getBranch());
verify(builder, times(3)).onData(artifactCaptor.capture());
verify(builder, times(7)).onData(attributeCaptor.capture());
@@ -202,7 +201,7 @@ public class LoaderTest {
@org.junit.Test
public void testLoadByTypes() throws OseeCoreException {
DataLoader loader =
- loaderFactory.newDataLoaderFromIds(session, COMMON_ID, OseeTypesFrameworkId, OseeTypesDemoId, UserGroupsId);
+ loaderFactory.newDataLoaderFromIds(session, COMMON, OseeTypesFrameworkId, OseeTypesDemoId, UserGroupsId);
loader.withLoadLevel(LoadLevel.ALL);
loader.withAttributeTypes(Name);
@@ -215,7 +214,7 @@ public class LoaderTest {
verify(builder).onLoadEnd();
LoadDescription descriptor = descriptorCaptor.getValue();
- assertEquals(COMMON_ID, descriptor.getBranchId());
+ assertEquals(COMMON, descriptor.getBranch());
verify(builder, times(3)).onData(artifactCaptor.capture());
verify(builder, times(3)).onData(attributeCaptor.capture());
@@ -244,7 +243,7 @@ public class LoaderTest {
@org.junit.Test
public void testLoadByIds() throws OseeCoreException {
DataLoader loader =
- loaderFactory.newDataLoaderFromIds(session, COMMON_ID, OseeTypesFrameworkId, OseeTypesDemoId, UserGroupsId);
+ loaderFactory.newDataLoaderFromIds(session, COMMON, OseeTypesFrameworkId, OseeTypesDemoId, UserGroupsId);
loader.withLoadLevel(LoadLevel.ALL);
loader.withAttributeIds(4, 10);
@@ -257,7 +256,7 @@ public class LoaderTest {
verify(builder).onLoadEnd();
LoadDescription descriptor = descriptorCaptor.getValue();
- assertEquals(COMMON_ID, descriptor.getBranchId());
+ assertEquals(COMMON, descriptor.getBranch());
verify(builder, times(3)).onData(artifactCaptor.capture());
verify(builder, times(2)).onData(attributeCaptor.capture());
@@ -290,7 +289,7 @@ public class LoaderTest {
@org.junit.Test
public void testLoadByGuids() throws OseeCoreException {
String[] ids = new String[] {OseeTypesFrameworkGuid, OseeTypesDemoGuid, UserGroupsGuid};
- DataLoader loader = loaderFactory.newDataLoaderFromGuids(session, COMMON_ID, ids);
+ DataLoader loader = loaderFactory.newDataLoaderFromGuids(session, COMMON, ids);
loader.withLoadLevel(LoadLevel.ALL);
verifyArtsAttrAndRelData(loader);
}
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 bfa5ef51ea8..a5fd9a27c99 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
@@ -115,9 +115,9 @@ public class MissingChangeItemFactoryTest {
String sessionGuid = GUID.create();
when(session.getGuid()).thenReturn(sessionGuid);
- when(dataLoaderFactory.newDataLoaderFromIds(any(OrcsSession.class), eq(sourceBranch.getId()),
+ when(dataLoaderFactory.newDataLoaderFromIds(any(OrcsSession.class), eq(sourceBranch),
any(Collection.class))).thenReturn(sourceDataLoader);
- when(dataLoaderFactory.newDataLoaderFromIds(any(OrcsSession.class), eq(destBranch.getId()),
+ when(dataLoaderFactory.newDataLoaderFromIds(any(OrcsSession.class), eq(destBranch),
any(Collection.class))).thenReturn(destDataLoader);
when(applicQuery.getApplicabilityTokens(any(BranchId.class), any(BranchId.class))).thenReturn(applicMap);
changeItemFactory = new MissingChangeItemFactoryImpl(dataLoaderFactory);
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 e4d2981622c..1c64529ce79 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java
@@ -10,12 +10,13 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.loader;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotSame;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.HasLocalId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
@@ -50,7 +51,7 @@ import org.mockito.MockitoAnnotations;
* @author Roberto E. Escobar
*/
public class DataFactoryImplTest {
- private static final Long BRANCH_ID2 = Long.valueOf(11);
+ private static final BranchId BRANCH = BranchId.valueOf(11);
private static final TransactionId tx333 = TransactionId.valueOf(333);
private static final TransactionId tx444 = TransactionId.valueOf(444);
@@ -87,7 +88,7 @@ public class DataFactoryImplTest {
dataFactory = new DataFactoryImpl(idFactory, objectFactory, artifactCache);
// VERSION
- when(verData.getBranchId()).thenReturn(BRANCH_ID2);
+ when(verData.getBranch()).thenReturn(BRANCH);
when(verData.getGammaId()).thenReturn(222L);
when(verData.getTransactionId()).thenReturn(tx333);
when(verData.getStripeId()).thenReturn(tx444);
@@ -137,7 +138,7 @@ public class DataFactoryImplTest {
thrown.expect(OseeArgumentException.class);
thrown.expectMessage("Cannot create an instance of abstract type [artifactTypeToken]");
- dataFactory.create(COMMON_ID, artifactTypeToken, guid);
+ dataFactory.create(COMMON, artifactTypeToken, guid);
}
@Test
@@ -151,7 +152,7 @@ public class DataFactoryImplTest {
thrown.expect(OseeArgumentException.class);
thrown.expectMessage("Invalid guid [123] during artifact creation [type: artifactTypeToken]");
- dataFactory.create(COMMON_ID, artifactTypeToken, guid);
+ dataFactory.create(COMMON, artifactTypeToken, guid);
}
@Test
@@ -161,13 +162,13 @@ public class DataFactoryImplTest {
when(idFactory.getUniqueGuid(guid)).thenReturn(guid);
when(idFactory.getNextArtifactId()).thenReturn(987);
- ArtifactData actual = dataFactory.create(COMMON_ID, artifactTypeToken, guid);
+ ArtifactData actual = dataFactory.create(COMMON, artifactTypeToken, guid);
verify(idFactory).getUniqueGuid(guid);
verify(idFactory).getNextArtifactId();
VersionData actualVer = actual.getVersion();
- assertEquals(COMMON_ID, actualVer.getBranchId());
+ assertEquals(COMMON, actualVer.getBranch());
assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
assertEquals(TransactionId.SENTINEL, actualVer.getStripeId());
@@ -190,12 +191,12 @@ public class DataFactoryImplTest {
when(idFactory.getUniqueGuid(guid)).thenReturn(guid);
when(idFactory.getNextArtifactId()).thenReturn(987);
- ArtifactData actual = dataFactory.create(COMMON_ID, artifactTypeToken, guid);
+ ArtifactData actual = dataFactory.create(COMMON, artifactTypeToken, guid);
verify(idFactory).getUniqueGuid(guid);
verify(idFactory).getNextArtifactId();
VersionData actualVer = actual.getVersion();
- assertEquals(COMMON_ID, actualVer.getBranchId());
+ assertEquals(COMMON, actualVer.getBranch());
assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
assertEquals(TransactionId.SENTINEL, actualVer.getStripeId());
@@ -221,7 +222,7 @@ public class DataFactoryImplTest {
AttributeData actual = dataFactory.create(artData, attributeType);
VersionData actualVer = actual.getVersion();
- assertEquals(BRANCH_ID2, actualVer.getBranchId());
+ assertEquals(BRANCH, actualVer.getBranch());
assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
assertEquals(TransactionId.SENTINEL, actualVer.getStripeId());
@@ -254,10 +255,10 @@ public class DataFactoryImplTest {
when(localId1.getLocalId()).thenReturn(4562);
when(localId2.getLocalId()).thenReturn(9513);
- RelationData actual = dataFactory.createRelationData(relationType, COMMON_ID, localId1, localId2, "My rationale");
+ RelationData actual = dataFactory.createRelationData(relationType, COMMON, localId1, localId2, "My rationale");
VersionData actualVer = actual.getVersion();
- assertEquals(COMMON_ID, actualVer.getBranchId());
+ assertEquals(COMMON, actualVer.getBranch());
assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
assertEquals(TransactionId.SENTINEL, actualVer.getStripeId());
@@ -277,11 +278,11 @@ public class DataFactoryImplTest {
@Test
public void testIntroduceArtifactData() throws OseeCoreException {
- ArtifactData actual = dataFactory.introduce(COMMON_ID, artData);
+ ArtifactData actual = dataFactory.introduce(COMMON, artData);
VersionData actualVer = actual.getVersion();
assertNotSame(verData, actualVer);
- assertEquals(COMMON_ID, actualVer.getBranchId());
+ assertEquals(COMMON, actualVer.getBranch());
assertEquals(222L, actualVer.getGammaId());
assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
assertEquals(artData.getVersion().getStripeId(), actualVer.getStripeId());
@@ -298,11 +299,11 @@ public class DataFactoryImplTest {
@Test
public void testIntroduceAttributeData() throws OseeCoreException {
- AttributeData actual = dataFactory.introduce(COMMON_ID, attrData);
+ AttributeData actual = dataFactory.introduce(COMMON, attrData);
VersionData actualVer = actual.getVersion();
assertNotSame(verData, actualVer);
- assertEquals(COMMON_ID, actualVer.getBranchId());
+ assertEquals(COMMON, actualVer.getBranch());
assertEquals(222L, actualVer.getGammaId());
assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
assertEquals(attrData.getVersion().getStripeId(), actualVer.getStripeId());
@@ -331,12 +332,12 @@ public class DataFactoryImplTest {
when(idFactory.getNextArtifactId()).thenReturn(987);
when(idFactory.getUniqueGuid(null)).thenReturn(newGuid);
- ArtifactData actual = dataFactory.copy(COMMON_ID, artData);
+ ArtifactData actual = dataFactory.copy(COMMON, artData);
verify(idFactory).getUniqueGuid(null);
VersionData actualVer = actual.getVersion();
assertNotSame(verData, actualVer);
- assertEquals(COMMON_ID, actualVer.getBranchId());
+ assertEquals(COMMON, actualVer.getBranch());
assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
assertEquals(TransactionId.SENTINEL, actualVer.getStripeId());
@@ -353,11 +354,11 @@ public class DataFactoryImplTest {
@Test
public void testCopyAttributeData() throws OseeCoreException {
- AttributeData actual = dataFactory.copy(COMMON_ID, attrData);
+ AttributeData actual = dataFactory.copy(COMMON, attrData);
VersionData actualVer = actual.getVersion();
assertNotSame(verData, actualVer);
- assertEquals(COMMON_ID, actualVer.getBranchId());
+ assertEquals(COMMON, actualVer.getBranch());
assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
assertEquals(TransactionId.SENTINEL, actualVer.getStripeId());
@@ -388,7 +389,7 @@ public class DataFactoryImplTest {
assertNotSame(artData, actual);
assertNotSame(verData, actualVer);
- assertEquals(BRANCH_ID2, actualVer.getBranchId());
+ assertEquals(BRANCH, actualVer.getBranch());
assertEquals(222L, actualVer.getGammaId());
assertEquals(tx333, actualVer.getTransactionId());
assertEquals(tx444, actualVer.getStripeId());
@@ -413,7 +414,7 @@ public class DataFactoryImplTest {
assertNotSame(attrData, actual);
assertNotSame(verData, actualVer);
- assertEquals(BRANCH_ID2, actualVer.getBranchId());
+ assertEquals(BRANCH, actualVer.getBranch());
assertEquals(222L, actualVer.getGammaId());
assertEquals(tx333, actualVer.getTransactionId());
assertEquals(tx444, actualVer.getStripeId());
@@ -444,7 +445,7 @@ public class DataFactoryImplTest {
assertNotSame(relData, actual);
assertNotSame(verData, actualVer);
- assertEquals(BRANCH_ID2, actualVer.getBranchId());
+ assertEquals(BRANCH, actualVer.getBranch());
assertEquals(222L, actualVer.getGammaId());
assertEquals(tx333, actualVer.getTransactionId());
assertEquals(tx444, actualVer.getStripeId());
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java
index 6ac083126a5..3c1089abbbb 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java
@@ -11,7 +11,6 @@
package org.eclipse.osee.orcs.db.internal.loader;
import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
import static org.eclipse.osee.framework.core.enums.DeletionFlag.EXCLUDE_DELETED;
import static org.eclipse.osee.framework.core.enums.DeletionFlag.INCLUDE_DELETED;
import static org.junit.Assert.assertEquals;
@@ -137,7 +136,7 @@ public class DataLoaderFactoryImplTest {
public void testLoadFull() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ALL;
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.fromTransaction(EXPECTED_TX);
@@ -158,15 +157,15 @@ public class DataLoaderFactoryImplTest {
LoadLevel expectedLoadLevel = LoadLevel.ARTIFACT_DATA;
String expected =
"SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
- " jart1.art_id, art1.art_type_id, art1.guid\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_artifact art1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "art1.art_id = jart1.art_id AND jart1.query_id = ? AND art1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, txs1.transaction_id desc";
-
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ " jart1.art_id, art1.art_type_id, art1.guid\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_artifact art1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "art1.art_id = jart1.art_id AND jart1.query_id = ? AND art1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, txs1.transaction_id desc";
+
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
assertEquals(expectedLoadLevel, dataLoader.getLoadLevel());
@@ -181,15 +180,15 @@ public class DataLoaderFactoryImplTest {
LoadLevel expectedLoadLevel = LoadLevel.ARTIFACT_DATA;
String expected =
"SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
- " jart1.art_id, art1.art_type_id, art1.guid\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_artifact art1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "art1.art_id = jart1.art_id AND jart1.query_id = ? AND art1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, txs1.transaction_id desc";
-
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ " jart1.art_id, art1.art_type_id, art1.guid\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_artifact art1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "art1.art_id = jart1.art_id AND jart1.query_id = ? AND art1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, txs1.transaction_id desc";
+
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.includeDeletedArtifacts();
@@ -213,7 +212,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.transaction_id <= jart1.transaction_id AND txs1.mod_type != 3 AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.fromTransaction(EXPECTED_TX);
@@ -237,7 +236,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.transaction_id <= jart1.transaction_id AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.fromTransaction(EXPECTED_TX);
dataLoader.includeDeletedArtifacts();
@@ -256,15 +255,15 @@ public class DataLoaderFactoryImplTest {
String expected =
"SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
- " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
-
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
+
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
assertEquals(expectedLoadLevel, dataLoader.getLoadLevel());
@@ -280,15 +279,15 @@ public class DataLoaderFactoryImplTest {
String expected =
"SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
- " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_type_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
-
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_type_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
+
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withAttributeTypes(CoreAttributeTypes.Annotation);
@@ -306,15 +305,15 @@ public class DataLoaderFactoryImplTest {
String expected =
"SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
- " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_join_id jid1, osee_attribute att1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_type_id = jid1.id AND jid1.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
-
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_join_id jid1, osee_attribute att1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_type_id = jid1.id AND jid1.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
+
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withAttributeTypes(CoreAttributeTypes.Annotation, CoreAttributeTypes.Category);
@@ -332,15 +331,15 @@ public class DataLoaderFactoryImplTest {
String expected =
"SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
- " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
-
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
+
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withAttributeIds(45);
@@ -357,15 +356,15 @@ public class DataLoaderFactoryImplTest {
String expected =
"SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
- " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_join_id jid1, osee_attribute att1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_id = jid1.id AND jid1.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
-
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_join_id jid1, osee_attribute att1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_id = jid1.id AND jid1.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
+
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withAttributeIds(45, 55);
@@ -382,15 +381,15 @@ public class DataLoaderFactoryImplTest {
String expected =
"SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
- " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_join_id jid1, osee_join_id jid2, osee_attribute att1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_id = jid1.id AND jid1.query_id = ? AND att1.attr_type_id = jid2.id AND jid2.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
-
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_join_id jid1, osee_join_id jid2, osee_attribute att1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_id = jid1.id AND jid1.query_id = ? AND att1.attr_type_id = jid2.id AND jid2.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
+
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withAttributeIds(45, 55);
dataLoader.withAttributeTypes(CoreAttributeTypes.Annotation, CoreAttributeTypes.Category);
@@ -409,15 +408,15 @@ public class DataLoaderFactoryImplTest {
String expected =
"SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
- " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_id = ? AND att1.attr_type_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
-
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_id = ? AND att1.attr_type_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
+
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withAttributeIds(45);
dataLoader.withAttributeTypes(CoreAttributeTypes.Annotation);
@@ -436,15 +435,15 @@ public class DataLoaderFactoryImplTest {
String expected =
"SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
- " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
-
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
+
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.includeDeletedArtifacts();
@@ -469,7 +468,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.transaction_id <= jart1.transaction_id AND txs1.mod_type != 3 AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.fromTransaction(EXPECTED_TX);
@@ -494,7 +493,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.transaction_id <= jart1.transaction_id AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.fromTransaction(EXPECTED_TX);
dataLoader.includeDeletedArtifacts();
@@ -514,15 +513,15 @@ public class DataLoaderFactoryImplTest {
String expected =
"SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
-
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
assertEquals(expectedLoadLevel, dataLoader.getLoadLevel());
@@ -538,15 +537,15 @@ public class DataLoaderFactoryImplTest {
String expected =
"SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
-
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.includeDeletedArtifacts();
@@ -563,15 +562,15 @@ public class DataLoaderFactoryImplTest {
String expected =
"SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_type_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
-
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_type_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withRelationTypes(CoreRelationTypes.Default_Hierarchical__Child);
@@ -589,15 +588,15 @@ public class DataLoaderFactoryImplTest {
String expected =
"SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_join_id jid1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_type_id = jid1.id AND jid1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
-
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_join_id jid1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_type_id = jid1.id AND jid1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withRelationTypes(CoreRelationTypes.Default_Hierarchical__Child,
CoreRelationTypes.Dependency__Artifact);
@@ -617,15 +616,15 @@ public class DataLoaderFactoryImplTest {
String expected =
"SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
-
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withRelationIds(45);
@@ -642,15 +641,15 @@ public class DataLoaderFactoryImplTest {
String expected =
"SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_join_id jid1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = jid1.id AND jid1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
-
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_join_id jid1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = jid1.id AND jid1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withRelationIds(45, 55);
@@ -667,15 +666,15 @@ public class DataLoaderFactoryImplTest {
String expected =
"SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_join_id jid1, osee_join_id jid2, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = jid1.id AND jid1.query_id = ? AND rel1.rel_link_type_id = jid2.id AND jid2.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
-
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_join_id jid1, osee_join_id jid2, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = jid1.id AND jid1.query_id = ? AND rel1.rel_link_type_id = jid2.id AND jid2.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withRelationIds(45, 55);
dataLoader.withRelationTypes(CoreRelationTypes.Default_Hierarchical__Child,
@@ -695,15 +694,15 @@ public class DataLoaderFactoryImplTest {
String expected =
"SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = ? AND rel1.rel_link_type_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
-
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = ? AND rel1.rel_link_type_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withRelationIds(45);
dataLoader.withRelationTypes(CoreRelationTypes.Default_Hierarchical__Child);
@@ -730,7 +729,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.transaction_id <= jart1.transaction_id AND txs1.mod_type != 3 AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.fromTransaction(EXPECTED_TX);
@@ -746,15 +745,15 @@ public class DataLoaderFactoryImplTest {
LoadLevel expectedLoadLevel = LoadLevel.ALL;
String expected =
"SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
-
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.includeDeletedAttributes();
dataLoader.withAttributeIds(45, 55);
@@ -772,15 +771,15 @@ public class DataLoaderFactoryImplTest {
LoadLevel expectedLoadLevel = LoadLevel.ALL;
String expected =
"SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_type_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
-
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_type_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.includeDeletedRelations();
dataLoader.withRelationTypes(CoreRelationTypes.Default_Hierarchical__Child);
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 d1d1058bc04..1f231de45c9 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
@@ -27,6 +27,7 @@ import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.BranchArchivedState;
import org.eclipse.osee.framework.core.enums.BranchState;
import org.eclipse.osee.framework.core.enums.BranchType;
+import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.jdbc.JdbcClient;
@@ -434,7 +435,7 @@ public class BranchQuerySqlContextFactoryImplTest {
"mbr1.merge_branch_id = br1.branch_id\n" + //
" ORDER BY br1.branch_id";
- queryData.addCriteria(new CriteriaMergeBranchFor(1L, 2L));
+ queryData.addCriteria(new CriteriaMergeBranchFor(CoreBranches.SYSTEM_ROOT, COMMON));
QuerySqlContext context = queryEngine.createQueryContext(session, queryData);
@@ -446,8 +447,8 @@ public class BranchQuerySqlContextFactoryImplTest {
assertEquals(0, joins.size());
Iterator<Object> iterator = parameters.iterator();
- assertEquals(1L, iterator.next());
- assertEquals(2L, iterator.next());
+ assertEquals(CoreBranches.SYSTEM_ROOT, iterator.next());
+ assertEquals(COMMON, iterator.next());
}
@Test
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriterTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriterTest.java
index bb5124d0635..c4a11003e85 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriterTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriterTest.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.transaction;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.inOrder;
@@ -45,13 +46,11 @@ import org.mockito.stubbing.Answer;
/**
* Test Case for {@link TransactionWriter}
- *
+ *
* @author Roberto E. Escobar
*/
public class TransactionWriterTest {
- private static final long BRANCH_ID = 65L;
-
private static final int QUERY_ID_1 = 88;
private static final int QUERY_ID_2 = 89;
@@ -64,17 +63,17 @@ public class TransactionWriterTest {
//@formatter:off
@Mock private Log logger;
@Mock private JdbcClient jdbcClient;
-
-
+
+
@Mock private TxSqlBuilder builder;
@Mock private JdbcConnection connection;
@Mock private TransactionReadable tx;
@Mock private DaoToSql dao1;
@Mock private DaoToSql dao2;
-
+
@Mock private IdJoinQuery join1;
@Mock private IdJoinQuery join2;
-
+
@Mock private JdbcStatement chStmt;
@Captor private ArgumentCaptor<List<Object[]>> paramCaptor;
@Mock private OrcsChangeSet changeSet;
@@ -98,7 +97,7 @@ public class TransactionWriterTest {
when(join1.getQueryId()).thenReturn(QUERY_ID_1);
when(join2.getQueryId()).thenReturn(QUERY_ID_2);
- when(tx.getBranchId()).thenReturn(BRANCH_ID);
+ when(tx.getBranch()).thenReturn(COMMON);
when(builder.getBinaryStores()).thenReturn(stores);
when(builder.getTxNotCurrents()).thenAnswer(new Answer<Set<Entry<SqlOrderEnum, IdJoinQuery>>>() {
@@ -146,11 +145,11 @@ public class TransactionWriterTest {
inOrder.verify(builder).getTxNotCurrents();
inOrder.verify(join1).store();
- inOrder.verify(chStmt).runPreparedQuery(SqlOrderEnum.ARTIFACTS.getTxsNotCurrentQuery(), QUERY_ID_1, BRANCH_ID);
+ inOrder.verify(chStmt).runPreparedQuery(SqlOrderEnum.ARTIFACTS.getTxsNotCurrentQuery(), QUERY_ID_1, COMMON);
inOrder.verify(join1).delete();
inOrder.verify(join2).store();
- inOrder.verify(chStmt).runPreparedQuery(SqlOrderEnum.ATTRIBUTES.getTxsNotCurrentQuery(), QUERY_ID_2, BRANCH_ID);
+ inOrder.verify(chStmt).runPreparedQuery(SqlOrderEnum.ATTRIBUTES.getTxsNotCurrentQuery(), QUERY_ID_2, COMMON);
inOrder.verify(join2).delete();
inOrder.verify(builder).getInsertData(SqlOrderEnum.ARTIFACTS);
@@ -167,13 +166,13 @@ public class TransactionWriterTest {
Iterator<Object[]> params = paramCaptor.getValue().iterator();
int index = 0;
Object[] data = params.next();
- Assert.assertEquals(BRANCH_ID, data[index++]);
+ Assert.assertEquals(COMMON, data[index++]);
Assert.assertEquals(TX_1, data[index++]);
Assert.assertEquals(GAMMA_1, data[index++]);
index = 0;
data = params.next();
- Assert.assertEquals(BRANCH_ID, data[index++]);
+ Assert.assertEquals(COMMON, data[index++]);
Assert.assertEquals(TX_2, data[index++]);
Assert.assertEquals(GAMMA_2, data[index++]);
}
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 c15b542269e..3c967027e2e 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
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.transaction;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.eclipse.osee.framework.core.enums.ModificationType.ARTIFACT_DELETED;
import static org.eclipse.osee.framework.core.enums.ModificationType.DELETED;
import static org.eclipse.osee.framework.core.enums.ModificationType.INTRODUCED;
@@ -73,7 +74,6 @@ public class TxSqlBuilderTest {
private static final TransactionId EXPECTED_TX = TransactionId.valueOf(10000);
private static final TransactionId LOADED_TX_ID = TransactionId.valueOf(567);
private static final ArtifactId EXPECTED_COMMIT_ART = ArtifactId.valueOf(46);
- private static final long EXPECTED_BRANCH_ID = 65L;
private static final ArtifactId EXPECTED_AUTHOR = ArtifactId.valueOf(89);
private static final String EXPECTED_COMMENT = "My comment";
private static final TransactionDetailsType EXPECTED_TX_TYPE = TransactionDetailsType.Baselined;
@@ -116,7 +116,7 @@ public class TxSqlBuilderTest {
MockitoAnnotations.initMocks(this);
versionData = new VersionDataImpl();
- versionData.setBranchId(EXPECTED_BRANCH_ID);
+ versionData.setBranch(COMMON);
versionData.setTransactionId(LOADED_TX_ID);
builder = new TxSqlBuilderImpl(joinFactory, idManager);
@@ -143,7 +143,7 @@ public class TxSqlBuilderTest {
relData.setRationale(RATIONALE);
tx.setAuthor(EXPECTED_AUTHOR);
- tx.setBranchId(EXPECTED_BRANCH_ID);
+ tx.setBranch(COMMON);
tx.setComment(EXPECTED_COMMENT);
tx.setCommitArt(EXPECTED_COMMIT_ART);
tx.setDate(EXPECTED_TX_TIME);
@@ -186,7 +186,7 @@ public class TxSqlBuilderTest {
assertEquals(EXPECTED_COMMENT, data[index++]);
assertEquals(EXPECTED_TX_TIME, data[index++]);
assertEquals(EXPECTED_AUTHOR, data[index++]);
- assertEquals(EXPECTED_BRANCH_ID, data[index++]);
+ assertEquals(COMMON, data[index++]);
assertEquals(EXPECTED_TX_TYPE.getId(), data[index++]);
}
@@ -203,7 +203,7 @@ public class TxSqlBuilderTest {
// @formatter:off
verifyRow(SqlOrderEnum.ARTIFACTS, ITEM_ID, TYPE_UUID, NEXT_GAMMA_ID, EXP_GUID);
- verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, NEXT_GAMMA_ID, modType.getValue(), TxChange.CURRENT.getValue(), EXPECTED_BRANCH_ID);
+ verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, NEXT_GAMMA_ID, modType.getValue(), TxChange.CURRENT.getValue(), COMMON);
verifyQuery(SqlOrderEnum.ARTIFACTS);
// @formatter:on
@@ -225,7 +225,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(), EXPECTED_BRANCH_ID);
+ verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, -1L, expectedType.getValue(), TxChange.getCurrent(expectedType).getValue(), COMMON);
verifyQuery(SqlOrderEnum.ARTIFACTS);
// @formatter:on
@@ -273,7 +273,7 @@ public class TxSqlBuilderTest {
// @formatter:off
verifyRow(SqlOrderEnum.RELATIONS, ITEM_ID, TYPE_UUID, NEXT_GAMMA_ID, A_ART_ID, B_ART_ID, RATIONALE);
- verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, NEXT_GAMMA_ID, modType.getValue(), TxChange.CURRENT.getValue(), EXPECTED_BRANCH_ID);
+ verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, NEXT_GAMMA_ID, modType.getValue(), TxChange.CURRENT.getValue(), COMMON);
verifyQuery(SqlOrderEnum.RELATIONS);
// @formatter:on
@@ -295,7 +295,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(), EXPECTED_BRANCH_ID);
+ verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, -1L, expectedType.getValue(), TxChange.getCurrent(expectedType).getValue(), COMMON);
verifyQuery(SqlOrderEnum.RELATIONS);
// @formatter:on
@@ -317,7 +317,7 @@ public class TxSqlBuilderTest {
// @formatter:off
verifyRow(SqlOrderEnum.ATTRIBUTES, ITEM_ID, TYPE_UUID, NEXT_GAMMA_ID, ATTR_ARTIFACT_ID, ATTR_VALUE, ATTR_URI);
- verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, NEXT_GAMMA_ID, modType.getValue(), TxChange.CURRENT.getValue(), EXPECTED_BRANCH_ID);
+ verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, NEXT_GAMMA_ID, modType.getValue(), TxChange.CURRENT.getValue(), COMMON);
verifyQuery(SqlOrderEnum.ATTRIBUTES);
// @formatter:on
@@ -351,7 +351,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(), EXPECTED_BRANCH_ID);
+ verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, -1L, expectedType.getValue(), TxChange.getCurrent(expectedType).getValue(), COMMON);
verifyQuery(SqlOrderEnum.ATTRIBUTES);
// @formatter:on
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/UpdatePreviousTxCurrent.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/UpdatePreviousTxCurrent.java
index d72fbd91159..0931629ffdf 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/UpdatePreviousTxCurrent.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/UpdatePreviousTxCurrent.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.orcs.db.internal.accessor;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.osee.framework.core.data.TransactionId;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.TxChange;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.jdbc.JdbcClient;
@@ -44,16 +45,16 @@ public class UpdatePreviousTxCurrent {
private final JdbcClient jdbcClient;
private final SqlJoinFactory joinFactory;
- private final long branchUuid;
+ private final BranchId branch;
private final JdbcConnection connection;
private IdJoinQuery artifactJoin;
private IdJoinQuery attributeJoin;
private IdJoinQuery relationJoin;
- public UpdatePreviousTxCurrent(JdbcClient jdbcClient, SqlJoinFactory joinFactory, JdbcConnection connection, long branchUuid) {
+ public UpdatePreviousTxCurrent(JdbcClient jdbcClient, SqlJoinFactory joinFactory, JdbcConnection connection, BranchId branch) {
this.jdbcClient = jdbcClient;
this.joinFactory = joinFactory;
- this.branchUuid = branchUuid;
+ this.branch = branch;
this.connection = connection;
}
@@ -98,10 +99,10 @@ public class UpdatePreviousTxCurrent {
List<Object[]> updateData = new ArrayList<>();
JdbcStatement chStmt = jdbcClient.getStatement(connection);
try {
- chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, query, queryId, branchUuid,
+ chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, query, queryId, branch,
TxChange.NOT_CURRENT.getValue());
while (chStmt.next()) {
- updateData.add(new Object[] {branchUuid, chStmt.getLong("gamma_id"), chStmt.getLong("transaction_id")});
+ updateData.add(new Object[] {branch, chStmt.getLong("gamma_id"), chStmt.getLong("transaction_id")});
}
} finally {
chStmt.close();
@@ -114,10 +115,10 @@ public class UpdatePreviousTxCurrent {
List<Object[]> updateData = new ArrayList<>();
JdbcStatement chStmt = jdbcClient.getStatement(connection);
try {
- chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, SELECT_TXS_AND_GAMMAS_FROM_TXS, branchUuid,
- transaction_id, branchUuid, transaction_id, TxChange.NOT_CURRENT.getValue());
+ chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, SELECT_TXS_AND_GAMMAS_FROM_TXS, branch,
+ transaction_id, branch, transaction_id, TxChange.NOT_CURRENT.getValue());
while (chStmt.next()) {
- updateData.add(new Object[] {branchUuid, chStmt.getLong("gamma_id"), chStmt.getLong("transaction_id")});
+ updateData.add(new Object[] {branch, chStmt.getLong("gamma_id"), chStmt.getLong("transaction_id")});
}
} finally {
chStmt.close();
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/BranchCopyTxCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/BranchCopyTxCallable.java
index 59840a25e1d..16b506d54c6 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/BranchCopyTxCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/BranchCopyTxCallable.java
@@ -74,14 +74,14 @@ public final class BranchCopyTxCallable extends JdbcTransaction {
String creationComment = branchData.getCreationComment();
- jdbcClient.runPreparedUpdate(connection, INSERT_TX_DETAILS, branchData.getUuid(), nextTransactionId,
+ jdbcClient.runPreparedUpdate(connection, INSERT_TX_DETAILS, branchData.getBranch(), nextTransactionId,
creationComment, timestamp, branchData.getAuthor(), TransactionDetailsType.NonBaselined.getId());
populateTransaction(0.30, connection, nextTransactionId, branchData.getParentBranch(),
branchData.getSavedTransaction());
UpdatePreviousTxCurrent updater =
- new UpdatePreviousTxCurrent(jdbcClient, joinFactory, connection, branchData.getUuid());
+ new UpdatePreviousTxCurrent(jdbcClient, joinFactory, connection, branchData.getBranch());
updater.updateTxNotCurrentsFromTx(nextTransactionId);
}
@@ -111,7 +111,7 @@ public final class BranchCopyTxCallable extends JdbcTransaction {
gamma,
modType.getValue(),
txCurrent.getValue(),
- branchData.getUuid(),
+ branchData.getBranch(),
app_id});
gammas.add(gamma);
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CommitBranchDatabaseTxCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CommitBranchDatabaseTxCallable.java
index 6f82b33c212..92c23e78f8d 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CommitBranchDatabaseTxCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CommitBranchDatabaseTxCallable.java
@@ -125,7 +125,7 @@ public class CommitBranchDatabaseTxCallable extends AbstractDatastoreTxCallable<
private void updatePreviousCurrentsOnDestinationBranch(JdbcConnection connection) throws OseeCoreException {
UpdatePreviousTxCurrent updater =
- new UpdatePreviousTxCurrent(getJdbcClient(), joinFactory, connection, destinationBranch.getUuid());
+ new UpdatePreviousTxCurrent(getJdbcClient(), joinFactory, connection, destinationBranch);
for (ChangeItem change : changes) {
switch (change.getChangeType()) {
case ARTIFACT_CHANGE:
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CreateBranchDatabaseTxCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CreateBranchDatabaseTxCallable.java
index 6731126b893..d32ed2e9802 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CreateBranchDatabaseTxCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CreateBranchDatabaseTxCallable.java
@@ -152,7 +152,7 @@ public class CreateBranchDatabaseTxCallable extends JdbcTransaction {
checkPreconditions(connection, parentBranch, destinationBranchUuid);
- long uuid = newBranchData.getUuid();
+ BranchId branch = newBranchData.getBranch();
final String truncatedName = Strings.truncate(newBranchData.getName(), 195, true);
@@ -179,7 +179,7 @@ public class CreateBranchDatabaseTxCallable extends JdbcTransaction {
//write to branch table
Object[] toInsert = new Object[] {
- uuid,
+ branch,
truncatedName,
parentBranch,
sourceTx,
@@ -193,16 +193,16 @@ public class CreateBranchDatabaseTxCallable extends JdbcTransaction {
jdbcClient.runPreparedUpdate(connection, INSERT_BRANCH, toInsert);
if (inheritAccessControl != 0) {
- copyAccessRules(newBranchData.getAuthor(), parentBranch, uuid);
+ copyAccessRules(newBranchData.getAuthor(), parentBranch, branch);
}
nextTransactionId = tobeTransactionId;
- jdbcClient.runPreparedUpdate(connection, INSERT_TX_DETAILS, uuid, nextTransactionId,
+ jdbcClient.runPreparedUpdate(connection, INSERT_TX_DETAILS, branch, nextTransactionId,
newBranchData.getCreationComment(), timestamp, newBranchData.getAuthor(),
TransactionDetailsType.Baselined.getId());
if (needsUpdate) {
- jdbcClient.runPreparedUpdate(connection, UPDATE_BASELINE_BRANCH_TX, nextTransactionId, uuid);
+ jdbcClient.runPreparedUpdate(connection, UPDATE_BASELINE_BRANCH_TX, nextTransactionId, branch);
}
populateBaseTransaction(0.30, connection, nextTransactionId, sourceTx);
@@ -213,7 +213,7 @@ public class CreateBranchDatabaseTxCallable extends JdbcTransaction {
private void addMergeBranchEntry(double workAmount, JdbcConnection connection) {
if (newBranchData.getBranchType().isMergeBranch()) {
jdbcClient.runPreparedUpdate(connection, MERGE_BRANCH_INSERT, newBranchData.getParentBranch(),
- newBranchData.getMergeDestinationBranchId(), newBranchData.getUuid(), 0);
+ newBranchData.getMergeDestinationBranchId(), newBranchData.getBranch(), 0);
}
}
@@ -241,7 +241,7 @@ public class CreateBranchDatabaseTxCallable extends JdbcTransaction {
JdbcStatement chStmt = jdbcClient.getStatement(connection);
try {
chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, query, parameters);
- Long branchId = newBranchData.getUuid();
+ BranchId branchId = newBranchData.getBranch();
while (chStmt.next()) {
Long gamma = chStmt.getLong("gamma_id");
if (!gammas.contains(gamma)) {
@@ -257,7 +257,7 @@ public class CreateBranchDatabaseTxCallable extends JdbcTransaction {
}
}
- private void copyAccessRules(ArtifactId author, BranchId parentBranch, Long branchUuid) {
+ private void copyAccessRules(ArtifactId author, BranchId parentBranch, BranchId branch) {
int lock = PermissionEnum.LOCK.getPermId();
int deny = PermissionEnum.DENY.getPermId();
@@ -268,7 +268,7 @@ public class CreateBranchDatabaseTxCallable extends JdbcTransaction {
if (author.equals(priviledgeId) && permissionId < lock && permissionId != deny) {
permissionId = lock;
}
- data.add(new Object[] {permissionId, priviledgeId, branchUuid});
+ data.add(new Object[] {permissionId, priviledgeId, branch});
}, JdbcConstants.JDBC__MAX_FETCH_SIZE, GET_BRANCH_ACCESS_CONTROL_LIST, parentBranch);
if (!data.isEmpty()) {
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenTxsOnTheSameBranch.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenTxsOnTheSameBranch.java
index 12dd5e3eea6..f46fe4ea40c 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenTxsOnTheSameBranch.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenTxsOnTheSameBranch.java
@@ -83,10 +83,6 @@ public class LoadDeltasBetweenTxsOnTheSameBranch extends AbstractDatastoreCallab
return ApplicabilityToken.BASE;
}
- private Long getBranchId() {
- return getEndTx().getBranchId();
- }
-
private TransactionToken getEndTx() {
return txDelta.getEndTx();
}
@@ -146,8 +142,8 @@ public class LoadDeltasBetweenTxsOnTheSameBranch extends AbstractDatastoreCallab
}
};
String query = String.format(SELECT_ITEMS_BETWEEN_TRANSACTIONS, isArchived ? "_archived" : "");
- getJdbcClient().runQuery(consumer, JdbcConstants.JDBC__MAX_FETCH_SIZE, query, getBranchId(), getStartTx(),
- getEndTx());
+ getJdbcClient().runQuery(consumer, JdbcConstants.JDBC__MAX_FETCH_SIZE, query, getEndTx().getBranch(),
+ getStartTx(), getEndTx());
return hashChangeData;
}
@@ -199,7 +195,7 @@ public class LoadDeltasBetweenTxsOnTheSameBranch extends AbstractDatastoreCallab
archiveTable, archiveTable);
getJdbcClient().runQuery(consumer, JdbcConstants.JDBC__MAX_FETCH_SIZE, query, queryId,
- transactionLimit.getBranchId(), transactionLimit, queryId, transactionLimit.getBranchId(), transactionLimit,
- queryId, transactionLimit.getBranchId(), transactionLimit);
+ transactionLimit.getBranch(), transactionLimit, queryId, transactionLimit.getBranch(), transactionLimit,
+ queryId, transactionLimit.getBranch(), transactionLimit);
}
} \ No newline at end of file
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 56ca3528ed7..692b23b0ded 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
@@ -114,7 +114,7 @@ public class MissingChangeItemFactoryImpl implements MissingChangeItemFactory {
}
private Set<Integer> determineWhichArtifactsNotOnDestination(HasCancellation cancellation, OrcsSession session, Set<Integer> artIds, TransactionToken destTx) throws OseeCoreException {
- DataLoader loader = dataLoaderFactory.newDataLoaderFromIds(session, destTx.getBranchId(), artIds);
+ DataLoader loader = dataLoaderFactory.newDataLoaderFromIds(session, destTx.getBranch(), artIds);
final Set<Integer> missingArtIds = new LinkedHashSet<>(artIds);
loader.includeDeletedArtifacts();
loader.fromTransaction(destTx);
@@ -133,7 +133,7 @@ public class MissingChangeItemFactoryImpl implements MissingChangeItemFactory {
final Set<ChangeItem> toReturn = new LinkedHashSet<>();
final Set<RelationData> relations = new LinkedHashSet<>();
- DataLoader loader = dataLoaderFactory.newDataLoaderFromIds(session, sourceTx.getBranchId(), missingArtIds);
+ DataLoader loader = dataLoaderFactory.newDataLoaderFromIds(session, sourceTx.getBranch(), missingArtIds);
loader.withLoadLevel(LoadLevel.ALL);
loader.includeDeletedArtifacts();
loader.fromTransaction(sourceTx);
@@ -191,7 +191,7 @@ public class MissingChangeItemFactoryImpl implements MissingChangeItemFactory {
final Set<ChangeItem> toReturn = new LinkedHashSet<>();
DataLoader loader =
- dataLoaderFactory.newDataLoaderFromIds(session, destTx.getBranchId(), relationChangesToAdd.keySet());
+ dataLoaderFactory.newDataLoaderFromIds(session, destTx.getBranch(), relationChangesToAdd.keySet());
loader.fromTransaction(destTx);
loader.load(cancellation, new LoadDataHandlerAdapter() {
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 62e0e99ea63..1b52219c9d4 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
@@ -50,12 +50,12 @@ public class DataFactoryImpl implements DataFactory {
}
@Override
- public ArtifactData create(Long branch, IArtifactType token, String guid) throws OseeCoreException {
+ public ArtifactData create(BranchId branch, IArtifactType token, String guid) throws OseeCoreException {
return this.create(branch, token, guid, idFactory.getNextArtifactId());
}
@Override
- public ArtifactData create(Long branchId, IArtifactType token, String guid, long artifactId) throws OseeCoreException {
+ public ArtifactData create(BranchId branchId, IArtifactType token, String guid, long artifactId) throws OseeCoreException {
Conditions.checkNotNull(branchId, "branch");
Conditions.checkExpressionFailOnTrue(artifactCache.isAbstract(token),
@@ -67,7 +67,7 @@ public class DataFactoryImpl implements DataFactory {
"Invalid guid [%s] during artifact creation [type: %s]", guidToSet, token);
VersionData version = objectFactory.createDefaultVersionData();
- version.setBranchId(branchId);
+ version.setBranch(branchId);
ModificationType modType = RelationalConstants.DEFAULT_MODIFICATION_TYPE;
ArtifactData artifactData =
@@ -76,7 +76,7 @@ public class DataFactoryImpl implements DataFactory {
}
@Override
- public ArtifactData copy(Long destination, ArtifactData source) throws OseeCoreException {
+ public ArtifactData copy(BranchId destination, ArtifactData source) throws OseeCoreException {
ArtifactData copy = objectFactory.createCopy(source);
updateDataForCopy(destination, copy);
copy.setGuid(idFactory.getUniqueGuid(null));
@@ -85,7 +85,7 @@ public class DataFactoryImpl implements DataFactory {
}
@Override
- public AttributeData introduce(Long destination, AttributeData source) throws OseeCoreException {
+ public AttributeData introduce(BranchId destination, AttributeData source) throws OseeCoreException {
AttributeData newVersion = objectFactory.createCopy(source);
newVersion.setUseBackingData(true);
updateDataForIntroduce(destination, newVersion);
@@ -95,7 +95,7 @@ public class DataFactoryImpl implements DataFactory {
@Override
public AttributeData create(ArtifactData parent, IAttributeType attributeType) throws OseeCoreException {
VersionData version = objectFactory.createDefaultVersionData();
- version.setBranchId(parent.getVersion().getBranchId());
+ version.setBranch(parent.getVersion().getBranch());
ModificationType modType = RelationalConstants.DEFAULT_MODIFICATION_TYPE;
Integer attributeid = RelationalConstants.DEFAULT_ITEM_ID;
return objectFactory.createAttributeData(version, attributeid, attributeType, modType, parent.getLocalId(),
@@ -103,7 +103,7 @@ public class DataFactoryImpl implements DataFactory {
}
@Override
- public AttributeData copy(Long destination, AttributeData orcsData) throws OseeCoreException {
+ public AttributeData copy(BranchId destination, AttributeData orcsData) throws OseeCoreException {
AttributeData copy = objectFactory.createCopy(orcsData);
updateDataForCopy(destination, copy);
copy.setLocalId(RelationalConstants.DEFAULT_ITEM_ID);
@@ -111,7 +111,7 @@ public class DataFactoryImpl implements DataFactory {
}
@Override
- public ArtifactData introduce(Long destination, ArtifactData source) throws OseeCoreException {
+ public ArtifactData introduce(BranchId destination, ArtifactData source) throws OseeCoreException {
ArtifactData newVersion = objectFactory.createCopy(source);
newVersion.setUseBackingData(true);
updateDataForIntroduce(destination, newVersion);
@@ -119,9 +119,9 @@ public class DataFactoryImpl implements DataFactory {
}
@Override
- public RelationData createRelationData(IRelationType relationType, Long branchId, HasLocalId<Integer> aArt, HasLocalId<Integer> bArt, String rationale) throws OseeCoreException {
+ public RelationData createRelationData(IRelationType relationType, BranchId branch, HasLocalId<Integer> aArt, HasLocalId<Integer> bArt, String rationale) throws OseeCoreException {
VersionData version = objectFactory.createDefaultVersionData();
- version.setBranchId(branchId);
+ version.setBranch(branch);
ModificationType modType = RelationalConstants.DEFAULT_MODIFICATION_TYPE;
Integer relationId = RelationalConstants.DEFAULT_ITEM_ID;
return objectFactory.createRelationData(version, relationId, relationType, modType, aArt.getLocalId(),
@@ -150,7 +150,7 @@ public class DataFactoryImpl implements DataFactory {
}
@Override
- public RelationData introduce(Long destination, RelationData source) {
+ public RelationData introduce(BranchId destination, RelationData source) {
RelationData newVersion = objectFactory.createCopy(source);
newVersion.setUseBackingData(true);
updateDataForIntroduce(destination, newVersion);
@@ -172,9 +172,9 @@ public class DataFactoryImpl implements DataFactory {
return objectFactory.createCopy(source);
}
- private void updateDataForCopy(Long destination, OrcsData data) throws OseeCoreException {
+ private void updateDataForCopy(BranchId destination, OrcsData data) throws OseeCoreException {
VersionData version = data.getVersion();
- version.setBranchId(destination);
+ version.setBranch(destination);
version.setTransactionId(TransactionId.SENTINEL);
version.setStripeId(TransactionId.SENTINEL);
version.setHistorical(false);
@@ -183,9 +183,9 @@ public class DataFactoryImpl implements DataFactory {
data.setModType(ModificationType.NEW);
}
- private void updateDataForIntroduce(Long destination, OrcsData data) throws OseeCoreException {
+ private void updateDataForIntroduce(BranchId destination, OrcsData data) throws OseeCoreException {
VersionData version = data.getVersion();
- version.setBranchId(destination);
+ version.setBranch(destination);
version.setHistorical(false);
version.setTransactionId(TransactionId.SENTINEL);
// do not clear gammaId for introduce case so we reuse the same version
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImpl.java
index 49904be28d3..5b0c3348927 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImpl.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.orcs.db.internal.loader;
import java.util.Arrays;
import java.util.Collection;
import org.eclipse.osee.executor.admin.HasCancellation;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.util.Lib;
@@ -101,27 +102,27 @@ public class DataLoaderFactoryImpl implements DataLoaderFactory {
}
@Override
- public DataLoader newDataLoaderFromIds(OrcsSession session, Long branchId, Integer... ids) throws OseeCoreException {
- return newDataLoaderFromIds(session, branchId, Arrays.asList(ids));
+ public DataLoader newDataLoaderFromIds(OrcsSession session, BranchId branch, Integer... ids) throws OseeCoreException {
+ return newDataLoaderFromIds(session, branch, Arrays.asList(ids));
}
@Override
- public DataLoader newDataLoaderFromIds(OrcsSession session, Long branchId, Collection<Integer> ids) throws OseeCoreException {
- Conditions.checkNotNull(branchId, "branch");
+ public DataLoader newDataLoaderFromIds(OrcsSession session, BranchId branch, Collection<Integer> ids) throws OseeCoreException {
+ Conditions.checkNotNull(branch, "branch");
Options options = OptionsUtil.createOptions();
- return new DataLoaderImpl(logger, ids, options, session, branchId, loader, joinFactory);
+ return new DataLoaderImpl(logger, ids, options, session, branch, loader, joinFactory);
}
@Override
- public DataLoader newDataLoaderFromGuids(OrcsSession session, Long branchId, String... guids) throws OseeCoreException {
- return newDataLoaderFromGuids(session, branchId, Arrays.asList(guids));
+ public DataLoader newDataLoaderFromGuids(OrcsSession session, BranchId branch, String... guids) throws OseeCoreException {
+ return newDataLoaderFromGuids(session, branch, Arrays.asList(guids));
}
@Override
- public DataLoader newDataLoaderFromGuids(OrcsSession session, Long branchId, Collection<String> guids) throws OseeCoreException {
- Conditions.checkNotNull(branchId, "branch");
+ public DataLoader newDataLoaderFromGuids(OrcsSession session, BranchId branch, Collection<String> guids) throws OseeCoreException {
+ Conditions.checkNotNull(branch, "branch");
Options options = OptionsUtil.createOptions();
- return new DataLoaderImpl(logger, options, session, branchId, loader, guids, joinFactory);
+ return new DataLoaderImpl(logger, options, session, branch, loader, guids, joinFactory);
}
@SuppressWarnings("unchecked")
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderImpl.java
index 352f2189279..f95605d9dc6 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderImpl.java
@@ -15,6 +15,7 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.osee.executor.admin.HasCancellation;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.data.TransactionId;
@@ -50,30 +51,30 @@ public class DataLoaderImpl implements DataLoader {
private final Options options;
private final OrcsSession session;
- private final Long branchId;
+ private final BranchId branchId;
private final SqlObjectLoader sqlLoader;
private final SqlJoinFactory joinFactory;
- public DataLoaderImpl(Log logger, AbstractLoadExecutor loadExecutor, Options options, OrcsSession session, Long branchId, SqlObjectLoader sqlLoader, SqlJoinFactory joinFactory) {
- this(logger, options, session, branchId, sqlLoader, joinFactory);
+ public DataLoaderImpl(Log logger, AbstractLoadExecutor loadExecutor, Options options, OrcsSession session, BranchId branch, SqlObjectLoader sqlLoader, SqlJoinFactory joinFactory) {
+ this(logger, options, session, branch, sqlLoader, joinFactory);
this.loadExecutor = loadExecutor;
}
- public DataLoaderImpl(Log logger, Collection<Integer> artifactIds, Options options, OrcsSession session, Long branchId, SqlObjectLoader sqlLoader, SqlJoinFactory joinFactory) {
- this(logger, options, session, branchId, sqlLoader, joinFactory);
+ public DataLoaderImpl(Log logger, Collection<Integer> artifactIds, Options options, OrcsSession session, BranchId branch, SqlObjectLoader sqlLoader, SqlJoinFactory joinFactory) {
+ this(logger, options, session, branch, sqlLoader, joinFactory);
withArtifactIds(artifactIds);
}
- public DataLoaderImpl(Log logger, Options options, OrcsSession session, Long branchId, SqlObjectLoader sqlLoader, Collection<String> artifactIds, SqlJoinFactory joinFactory) {
- this(logger, options, session, branchId, sqlLoader, joinFactory);
+ public DataLoaderImpl(Log logger, Options options, OrcsSession session, BranchId branch, SqlObjectLoader sqlLoader, Collection<String> artifactIds, SqlJoinFactory joinFactory) {
+ this(logger, options, session, branch, sqlLoader, joinFactory);
withArtifactGuids(artifactIds);
}
- private DataLoaderImpl(Log logger, Options options, OrcsSession session, Long branchId, SqlObjectLoader sqlLoader, SqlJoinFactory joinFactory) {
+ private DataLoaderImpl(Log logger, Options options, OrcsSession session, BranchId branch, SqlObjectLoader sqlLoader, SqlJoinFactory joinFactory) {
this.logger = logger;
this.options = options;
this.session = session;
- this.branchId = branchId;
+ this.branchId = branch;
this.sqlLoader = sqlLoader;
this.joinFactory = joinFactory;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoadSqlContext.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoadSqlContext.java
index be6ff372bbf..9439d32c6d7 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoadSqlContext.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoadSqlContext.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.loader;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.HasBranch;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.ds.LoadContext;
@@ -21,15 +22,15 @@ import org.eclipse.osee.orcs.db.internal.sql.SqlContextImpl;
*/
public class LoadSqlContext extends SqlContextImpl implements LoadContext, HasBranch {
- private final Long branchId;
+ private final BranchId branch;
- public LoadSqlContext(OrcsSession session, Options options, Long branchId) {
+ public LoadSqlContext(OrcsSession session, Options options, BranchId branch) {
super(session, options);
- this.branchId = branchId;
+ this.branch = branch;
}
@Override
- public Long getBranchId() {
- return branchId;
+ public BranchId getBranch() {
+ return branch;
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/SqlObjectLoader.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/SqlObjectLoader.java
index 9ee371139c5..d158684f528 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/SqlObjectLoader.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/SqlObjectLoader.java
@@ -299,7 +299,7 @@ public class SqlObjectLoader {
@Override
public boolean isMultiBranch() {
- return getBranchId() == null;
+ return getBranch() == null;
}
@Override
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 e4ad3592bfb..54447d60d30 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
@@ -50,7 +50,7 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
}
@Override
- public VersionData createVersion(Long branchId, TransactionId txId, long gamma, boolean historical) {
+ public VersionData createVersion(BranchId branchId, TransactionId txId, long gamma, boolean historical) {
return createVersion(branchId, txId, gamma, historical, TransactionId.SENTINEL);
}
@@ -58,7 +58,7 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
public VersionData createDefaultVersionData() {
// @formatter:off
return createVersion(
- BranchId.SENTINEL.getId(),
+ BranchId.SENTINEL,
TransactionId.SENTINEL,
RelationalConstants.GAMMA_SENTINEL,
RelationalConstants.IS_HISTORICAL_DEFAULT,
@@ -70,7 +70,7 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
public VersionData createCopy(VersionData other) {
// @formatter:off
return createVersion(
- other.getBranchId(),
+ other.getBranch(),
other.getTransactionId(),
other.getGammaId(),
other.isHistorical(),
@@ -78,9 +78,9 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
// @formatter:on
}
- private VersionData createVersion(Long branchId, TransactionId txId, long gamma, boolean historical, TransactionId stripeId) {
+ private VersionData createVersion(BranchId branchId, TransactionId txId, long gamma, boolean historical, TransactionId stripeId) {
VersionData version = new VersionDataImpl();
- version.setBranchId(branchId);
+ version.setBranch(branchId);
version.setTransactionId(txId);
version.setGammaId(gamma);
version.setHistorical(historical);
@@ -212,12 +212,12 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
}
@Override
- public TxOrcsData createTxData(Long localId, TransactionDetailsType type, Date date, String comment, Long branchId, ArtifactId author, ArtifactId commitArt) {
+ public TxOrcsData createTxData(Long localId, TransactionDetailsType type, Date date, String comment, BranchId branch, ArtifactId author, ArtifactId commitArt) {
TxOrcsData data = new TransactionDataImpl(localId);
data.setTxType(type);
data.setDate(date);
data.setComment(comment);
- data.setBranchId(branchId);
+ data.setBranch(branch);
data.setAuthor(author);
data.setCommitArt(commitArt);
return data;
@@ -225,8 +225,8 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
@Override
public TxOrcsData createCopy(TxOrcsData source) {
- return createTxData(source.getId(), source.getTxType(), source.getDate(), source.getComment(),
- source.getBranchId(), source.getAuthor(), source.getCommitArt());
+ return createTxData(source.getId(), source.getTxType(), source.getDate(), source.getComment(), source.getBranch(),
+ source.getAuthor(), source.getCommitArt());
}
@Override
@@ -239,7 +239,7 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
data.setElement1(element1);
data.setElement2(element2);
data.getVersion().setGammaId(Lib.generateUuid());
- data.getVersion().setBranchId(branchId.getId());
+ data.getVersion().setBranch(branchId);
return data;
}
@@ -254,7 +254,7 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
data.setElement2(e2);
data.setElement3(e3);
data.getVersion().setGammaId(Lib.generateUuid());
- data.getVersion().setBranchId(branchId.getId());
+ data.getVersion().setBranch(branchId);
return data;
}
@@ -270,7 +270,7 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
data.setElement3(e3);
data.setElement4(e4);
data.getVersion().setGammaId(Lib.generateUuid());
- data.getVersion().setBranchId(branchId.getId());
+ data.getVersion().setBranch(branchId);
return data;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/TransactionDataImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/TransactionDataImpl.java
index 1d78dea6324..81d055fac55 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/TransactionDataImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/TransactionDataImpl.java
@@ -24,7 +24,7 @@ import org.eclipse.osee.orcs.core.ds.TxOrcsData;
public class TransactionDataImpl extends BaseId implements TxOrcsData {
private ArtifactId authorId = ArtifactId.SENTINEL;
- private Long branchId = BranchId.SENTINEL.getId();
+ private BranchId branch = BranchId.SENTINEL;
private String comment = RelationalConstants.DEFAULT_COMMENT;
private ArtifactId commitId = ArtifactId.SENTINEL;
private TransactionDetailsType type = TransactionDetailsType.INVALID;
@@ -40,8 +40,8 @@ public class TransactionDataImpl extends BaseId implements TxOrcsData {
}
@Override
- public Long getBranchId() {
- return branchId;
+ public BranchId getBranch() {
+ return branch;
}
@Override
@@ -70,8 +70,8 @@ public class TransactionDataImpl extends BaseId implements TxOrcsData {
}
@Override
- public void setBranchId(Long branchId) {
- this.branchId = branchId;
+ public void setBranch(BranchId branch) {
+ this.branch = branch;
}
@Override
@@ -96,6 +96,6 @@ public class TransactionDataImpl extends BaseId implements TxOrcsData {
@Override
public String toString() {
- return "TransactionDataImpl [id=" + getId() + ", authorId=" + authorId + ", branchUuid=" + branchId + ", comment=" + comment + ", commitId=" + commitId + ", date=" + date + ", type=" + type + "]";
+ return "TransactionDataImpl [id=" + getId() + ", authorId=" + authorId + ", branch=" + branch + ", comment=" + comment + ", commitId=" + commitId + ", date=" + date + ", type=" + type + "]";
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/TransactionObjectFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/TransactionObjectFactory.java
index 40db842b073..6ab46d8d56a 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/TransactionObjectFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/TransactionObjectFactory.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.orcs.db.internal.loader.data;
import java.util.Date;
import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.orcs.core.ds.TxOrcsData;
@@ -21,7 +22,7 @@ import org.eclipse.osee.orcs.core.ds.TxOrcsData;
*/
public interface TransactionObjectFactory extends OrcsDataFactory {
- TxOrcsData createTxData(Long localId, TransactionDetailsType type, Date date, String comment, Long branchId, ArtifactId author, ArtifactId commitArt) throws OseeCoreException;
+ TxOrcsData createTxData(Long localId, TransactionDetailsType type, Date date, String comment, BranchId branch, ArtifactId author, ArtifactId commitArt) throws OseeCoreException;
TxOrcsData createCopy(TxOrcsData source) throws OseeCoreException;
}
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 bd2b7c6a125..a223c16a3a8 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
@@ -21,7 +21,7 @@ import org.eclipse.osee.orcs.core.ds.VersionData;
*/
public class VersionDataImpl implements VersionData {
- private Long branchId = BranchId.SENTINEL.getId();
+ private BranchId branch = BranchId.SENTINEL;
private TransactionId txId = TransactionId.SENTINEL;
private long gamma = GAMMA_SENTINEL;
private boolean historical = IS_HISTORICAL_DEFAULT;
@@ -62,13 +62,13 @@ public class VersionDataImpl implements VersionData {
}
@Override
- public Long getBranchId() {
- return branchId;
+ public BranchId getBranch() {
+ return branch;
}
@Override
- public void setBranchId(Long branchUuid) {
- this.branchId = branchUuid;
+ public void setBranch(BranchId branch) {
+ this.branch = branch;
}
@Override
@@ -90,7 +90,7 @@ public class VersionDataImpl implements VersionData {
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result + branchId.hashCode();
+ result = prime * result + branch.hashCode();
result = prime * result + (int) (gamma ^ gamma >>> 32);
result = prime * result + (historical ? 1231 : 1237);
result = prime * result + stripeId.hashCode();
@@ -110,7 +110,7 @@ public class VersionDataImpl implements VersionData {
return false;
}
VersionDataImpl other = (VersionDataImpl) obj;
- if (!branchId.equals(other.branchId)) {
+ if (!branch.equals(other.branch)) {
return false;
}
if (gamma != other.gamma) {
@@ -130,13 +130,13 @@ public class VersionDataImpl implements VersionData {
@Override
public String toString() {
- return "Version [branchUuid=" + branchId + ", txId=" + txId + ", gamma=" + gamma + ", historical=" + historical + ", stripeId=" + stripeId + "]";
+ return "Version [branch=" + branch + ", txId=" + txId + ", gamma=" + gamma + ", historical=" + historical + ", stripeId=" + stripeId + "]";
}
@Override
public VersionData clone() {
VersionData copy = new VersionDataImpl();
- copy.setBranchId(getBranchId());
+ copy.setBranch(getBranch());
copy.setGammaId(getGammaId());
copy.setHistorical(isHistorical());
copy.setStripeId(getStripeId());
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 a9a4eef3d5c..b4b05d54423 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
@@ -10,6 +10,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.TransactionId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.orcs.core.ds.VersionData;
@@ -21,7 +22,7 @@ public interface VersionObjectFactory extends OrcsDataFactory {
VersionData createDefaultVersionData();
- VersionData createVersion(Long branchUuid, TransactionId txId, long gamma, boolean historical) throws OseeCoreException;
+ VersionData createVersion(BranchId branch, TransactionId txId, long 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/executors/ArtifactQueryContextLoadExecutor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/ArtifactQueryContextLoadExecutor.java
index 6a8ef860973..463b949e19b 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/ArtifactQueryContextLoadExecutor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/ArtifactQueryContextLoadExecutor.java
@@ -51,7 +51,7 @@ public class ArtifactQueryContextLoadExecutor extends AbstractLoadExecutor {
ArtifactJoinQuery join = createArtifactIdJoin(getJdbcClient(), cancellation, fetchSize);
- LoadSqlContext loadContext = new LoadSqlContext(queryContext.getSession(), options, queryContext.getBranchId());
+ LoadSqlContext loadContext = new LoadSqlContext(queryContext.getSession(), options, queryContext.getBranch());
getLoader().loadArtifacts(cancellation, handler, join, criteria, loadContext, fetchSize);
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/LoadExecutor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/LoadExecutor.java
index 06728d8164e..060d6e4353c 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/LoadExecutor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/LoadExecutor.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.orcs.db.internal.loader.executors;
import java.util.Collection;
import org.eclipse.osee.executor.admin.HasCancellation;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.jdbc.JdbcClient;
@@ -33,14 +34,14 @@ public class LoadExecutor extends AbstractLoadExecutor {
private final SqlJoinFactory joinFactory;
private final OrcsSession session;
- private final Long branchId;
+ private final BranchId branch;
private final Collection<Integer> artifactIds;
- public LoadExecutor(SqlObjectLoader loader, JdbcClient jdbcClient, SqlJoinFactory joinFactory, OrcsSession session, Long branchId, Collection<Integer> artifactIds) {
+ public LoadExecutor(SqlObjectLoader loader, JdbcClient jdbcClient, SqlJoinFactory joinFactory, OrcsSession session, BranchId branch, Collection<Integer> artifactIds) {
super(loader, jdbcClient);
this.joinFactory = joinFactory;
this.session = session;
- this.branchId = branchId;
+ this.branch = branch;
this.artifactIds = artifactIds;
}
@@ -51,11 +52,11 @@ public class LoadExecutor extends AbstractLoadExecutor {
ArtifactJoinQuery join = joinFactory.createArtifactJoinQuery();
TransactionId transactionId = OptionsUtil.getFromTransaction(options);
for (Integer artId : artifactIds) {
- join.add(artId, branchId, transactionId);
+ join.add(artId, branch.getId(), transactionId);
}
- LoadSqlContext loadContext = new LoadSqlContext(session, options, branchId);
+ LoadSqlContext loadContext = new LoadSqlContext(session, options, branch);
int fetchSize = LoadUtil.computeFetchSize(artifactIds.size());
getLoader().loadArtifacts(cancellation, handler, join, criteria, loadContext, fetchSize);
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/UuidsLoadExecutor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/UuidsLoadExecutor.java
index a1ff6764590..bbbd64a579c 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/UuidsLoadExecutor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/UuidsLoadExecutor.java
@@ -12,7 +12,9 @@ package org.eclipse.osee.orcs.db.internal.loader.executors;
import java.util.Collection;
import org.eclipse.osee.executor.admin.HasCancellation;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.TransactionId;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.orcs.OrcsSession;
@@ -37,14 +39,14 @@ public class UuidsLoadExecutor extends AbstractLoadExecutor {
private final SqlJoinFactory joinFactory;
private final OrcsSession session;
- private final Long branchId;
+ private final BranchId branch;
private final Collection<String> artifactIds;
- public UuidsLoadExecutor(SqlObjectLoader loader, JdbcClient jdbcClient, SqlJoinFactory joinFactory, OrcsSession session, Long branchId, Collection<String> artifactIds) {
+ public UuidsLoadExecutor(SqlObjectLoader loader, JdbcClient jdbcClient, SqlJoinFactory joinFactory, OrcsSession session, BranchId branch, Collection<String> artifactIds) {
super(loader, jdbcClient);
this.joinFactory = joinFactory;
this.session = session;
- this.branchId = branchId;
+ this.branch = branch;
this.artifactIds = artifactIds;
}
@@ -53,7 +55,7 @@ public class UuidsLoadExecutor extends AbstractLoadExecutor {
checkCancelled(cancellation);
if (!artifactIds.isEmpty()) {
ArtifactJoinQuery join = createIdJoin(getJdbcClient(), options);
- LoadSqlContext loadContext = new LoadSqlContext(session, options, branchId);
+ LoadSqlContext loadContext = new LoadSqlContext(session, options, branch);
int fetchSize = LoadUtil.computeFetchSize(artifactIds.size());
getLoader().loadArtifacts(cancellation, handler, join, criteria, loadContext, fetchSize);
}
@@ -74,7 +76,7 @@ public class UuidsLoadExecutor extends AbstractLoadExecutor {
getJdbcClient().runQuery(stmt -> {
Integer artId = stmt.getInt("art_id");
- toReturn.add(artId, branchId, transactionId);
+ toReturn.add(artId, branch.getId(), transactionId);
}, artifactIds.size(), GUIDS_TO_IDS, guidJoin.getQueryId());
} finally {
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 9c7f22f911e..b532832cffc 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
@@ -11,6 +11,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.TransactionId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -35,10 +36,10 @@ public class ArtifactLoadProcessor extends LoadProcessor<ArtifactData, ArtifactO
ArtifactData toReturn = null;
int artifactId = chStmt.getInt("art_id");
- long branchUuid = chStmt.getLong("branch_id");
+ BranchId branch = BranchId.valueOf(chStmt.getLong("branch_id"));
CreateConditions onCreate = asConditions(conditions);
- if (!onCreate.isSame(branchUuid, artifactId)) {
+ if (!onCreate.isSame(branch, artifactId)) {
ModificationType modType = ModificationType.getMod(chStmt.getInt("mod_type"));
ApplicabilityId applicId = ApplicabilityId.valueOf(chStmt.getLong("app_id"));
@@ -48,7 +49,7 @@ public class ArtifactLoadProcessor extends LoadProcessor<ArtifactData, ArtifactO
long gamma = chStmt.getInt("gamma_id");
TransactionId txId = TransactionId.valueOf(chStmt.getLong("transaction_id"));
- VersionData version = factory.createVersion(branchUuid, txId, gamma, historical);
+ VersionData version = factory.createVersion(branch, txId, gamma, historical);
if (historical) {
version.setStripeId(TransactionId.valueOf(chStmt.getLong("stripe_transaction_id")));
@@ -58,7 +59,7 @@ public class ArtifactLoadProcessor extends LoadProcessor<ArtifactData, ArtifactO
String guid = chStmt.getString("guid");
toReturn = factory.createArtifactData(version, artifactId, typeId, modType, guid, applicId);
}
- onCreate.saveConditions(branchUuid, artifactId);
+ onCreate.saveConditions(branch, artifactId);
}
return toReturn;
}
@@ -74,14 +75,14 @@ public class ArtifactLoadProcessor extends LoadProcessor<ArtifactData, ArtifactO
private static final class CreateConditions {
int previousArtId = -1;
- long previousBranchId = -1;
+ BranchId previousBranchId = BranchId.SENTINEL;
- boolean isSame(long branchUuid, int artifactId) {
- return previousBranchId == branchUuid && previousArtId == artifactId;
+ boolean isSame(BranchId branch, int artifactId) {
+ return previousBranchId.equals(branch) && previousArtId == artifactId;
}
- void saveConditions(long branchUuid, int artifactId) {
- previousBranchId = branchUuid;
+ void saveConditions(BranchId branch, int artifactId) {
+ previousBranchId = branch;
previousArtId = artifactId;
}
}
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 f3e8206300e..8e9d7043ac5 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
@@ -11,6 +11,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.TransactionId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -38,7 +39,7 @@ public class AttributeLoadProcessor extends LoadProcessor<AttributeData, Attribu
protected AttributeData createData(Object conditions, AttributeObjectFactory factory, JdbcStatement chStmt, Options options) throws OseeCoreException {
AttributeData toReturn = null;
- long branchUuid = chStmt.getLong("branch_id");
+ BranchId branch = BranchId.valueOf(chStmt.getLong("branch_id"));
int artId = chStmt.getInt("art_id");
int attrId = chStmt.getInt("attr_id");
long gammaId = chStmt.getInt("gamma_id");
@@ -48,12 +49,12 @@ public class AttributeLoadProcessor extends LoadProcessor<AttributeData, Attribu
boolean historical = OptionsUtil.isHistorical(options);
CreateConditions condition = asConditions(conditions);
- if (!condition.isSame(branchUuid, artId, attrId)) {
- condition.saveConditions(branchUuid, artId, attrId, gammaId, modType);
+ if (!condition.isSame(branch, artId, attrId)) {
+ condition.saveConditions(branch, artId, attrId, gammaId, modType);
TransactionId txId = TransactionId.valueOf(chStmt.getLong("transaction_id"));
- VersionData version = factory.createVersion(branchUuid, txId, gammaId, historical);
+ VersionData version = factory.createVersion(branch, txId, gammaId, historical);
if (historical) {
version.setStripeId(TransactionId.valueOf(chStmt.getLong("stripe_transaction_id")));
}
@@ -69,7 +70,7 @@ public class AttributeLoadProcessor extends LoadProcessor<AttributeData, Attribu
if (!historical) {
logger.warn(
"multiple attribute versions for attribute id [%d] artifact id[%d] branch[%d] previousGammaId[%s] currentGammaId[%s] previousModType[%s] currentModType[%s]",
- attrId, artId, branchUuid, condition.previousGammaId, gammaId, condition.previousModType, modType);
+ attrId, artId, branch, condition.previousGammaId, gammaId, condition.previousModType, modType);
}
}
return toReturn;
@@ -86,17 +87,17 @@ public class AttributeLoadProcessor extends LoadProcessor<AttributeData, Attribu
private static final class CreateConditions {
int previousArtId = -1;
- long previousBranchId = -1;
+ BranchId previousBranchId = BranchId.SENTINEL;
int previousAttrId = -1;
long previousGammaId = -1;
ModificationType previousModType = null;
- boolean isSame(long branchUuid, int artifactId, int attrId) {
- return previousBranchId == branchUuid && previousArtId == artifactId && previousAttrId == attrId;
+ boolean isSame(BranchId branch, int artifactId, int attrId) {
+ return previousBranchId.equals(branch) && previousArtId == artifactId && previousAttrId == attrId;
}
- void saveConditions(long branchUuid, int artifactId, int attrId, long gammaId, ModificationType modType) {
- previousBranchId = branchUuid;
+ void saveConditions(BranchId branch, int artifactId, int attrId, long gammaId, ModificationType modType) {
+ previousBranchId = branch;
previousArtId = artifactId;
previousAttrId = attrId;
previousGammaId = gammaId;
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 78c4dd97a0a..45744572753 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
@@ -11,6 +11,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.TransactionId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -38,7 +39,7 @@ public class RelationLoadProcessor extends LoadProcessor<RelationData, RelationO
protected RelationData createData(Object conditions, RelationObjectFactory factory, JdbcStatement chStmt, Options options) throws OseeCoreException {
RelationData toReturn = null;
- long branchUuid = chStmt.getLong("branch_id");
+ BranchId branch = BranchId.valueOf(chStmt.getLong("branch_id"));
int aArtId = chStmt.getInt("a_art_id");
int bArtId = chStmt.getInt("b_art_id");
long typeId = chStmt.getLong("rel_link_type_id");
@@ -48,12 +49,12 @@ public class RelationLoadProcessor extends LoadProcessor<RelationData, RelationO
boolean historical = OptionsUtil.isHistorical(options);
CreateConditions condition = asConditions(conditions);
- if (!condition.isSame(branchUuid, aArtId, bArtId, typeId)) {
- condition.saveConditions(branchUuid, aArtId, bArtId, typeId, gammaId);
+ if (!condition.isSame(branch, aArtId, bArtId, typeId)) {
+ condition.saveConditions(branch, aArtId, bArtId, typeId, gammaId);
TransactionId txId = TransactionId.valueOf(chStmt.getLong("transaction_id"));
- VersionData version = factory.createVersion(branchUuid, txId, gammaId, historical);
+ VersionData version = factory.createVersion(branch, txId, gammaId, historical);
if (historical) {
version.setStripeId(TransactionId.valueOf(chStmt.getLong("stripe_transaction_id")));
}
@@ -69,7 +70,7 @@ public class RelationLoadProcessor extends LoadProcessor<RelationData, RelationO
if (!historical) {
logger.warn(
"multiple relation versions for branch[%d] rel_type [%d] a_artId[%d] b_artId[%s] previousGammaId[%s] currentGammaId[%s]",
- branchUuid, typeId, aArtId, bArtId, condition.previousGammaId, gammaId);
+ branch, typeId, aArtId, bArtId, condition.previousGammaId, gammaId);
}
}
return toReturn;
@@ -85,18 +86,19 @@ public class RelationLoadProcessor extends LoadProcessor<RelationData, RelationO
}
private static final class CreateConditions {
- long previousBranchId = -1;
+ BranchId previousBranchId = BranchId.SENTINEL;
int previousArtIdA = -1;
int previousArtIdB = -1;
long previousTypeId = -1;
long previousGammaId = -1;
- boolean isSame(long branchUuid, int aArtId, int bArtId, long typeId) {
- return previousBranchId == branchUuid && previousArtIdA == aArtId && previousArtIdB == bArtId && previousTypeId == typeId;
+ boolean isSame(BranchId branch, int aArtId, int bArtId, long typeId) {
+ return previousBranchId.equals(
+ branch) && previousArtIdA == aArtId && previousArtIdB == bArtId && previousTypeId == typeId;
}
- void saveConditions(long branchUuid, int aArtId, int bArtId, long typeId, long gammaId) {
- previousBranchId = branchUuid;
+ void saveConditions(BranchId branch, int aArtId, int bArtId, long typeId, long gammaId) {
+ previousBranchId = branch;
previousArtIdA = aArtId;
previousArtIdB = bArtId;
previousTypeId = typeId;
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/TransactionLoadProcessor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/TransactionLoadProcessor.java
index d6eadad3e13..8a32e8d09c1 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/TransactionLoadProcessor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/TransactionLoadProcessor.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.orcs.db.internal.loader.processor;
import java.util.Date;
import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.jdbc.JdbcStatement;
@@ -30,13 +31,13 @@ public class TransactionLoadProcessor extends LoadProcessor<TxOrcsData, Transact
@Override
protected TxOrcsData createData(Object conditions, TransactionObjectFactory factory, JdbcStatement chStmt, Options options) throws OseeCoreException {
- long branchUuid = chStmt.getLong("branch_id");
+ BranchId branch = BranchId.valueOf(chStmt.getLong("branch_id"));
Long localId = chStmt.getLong("transaction_id");
TransactionDetailsType type = TransactionDetailsType.toEnum(chStmt.getInt("tx_type"));
String comment = chStmt.getString("osee_comment");
Date date = chStmt.getTimestamp("time");
ArtifactId authorId = ArtifactId.valueOf(chStmt.getLong("author"));
ArtifactId commitId = ArtifactId.valueOf(chStmt.getLong("commit_art_id"));
- return factory.createTxData(localId, type, date, comment, branchUuid, authorId, commitId);
+ return factory.createTxData(localId, type, date, comment, branch, authorId, commitId);
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContext.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContext.java
index d91e04146e0..358bcbc365f 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContext.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContext.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.search.engines;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.ds.Options;
import org.eclipse.osee.orcs.db.internal.search.QuerySqlContext;
@@ -19,19 +20,19 @@ import org.eclipse.osee.orcs.db.internal.search.QuerySqlContext;
*/
public class ArtifactQuerySqlContext extends QuerySqlContext {
- private final Long branchId;
+ private final BranchId branch;
- public ArtifactQuerySqlContext(OrcsSession session, Long branchId, Options options) {
+ public ArtifactQuerySqlContext(OrcsSession session, BranchId branchId, Options options) {
super(session, options, ObjectQueryType.ARTIFACT);
- this.branchId = branchId;
+ this.branch = branchId;
}
- public long getBranchId() {
- return branchId;
+ public BranchId getBranch() {
+ return branch;
}
@Override
public String toString() {
- return "ArtifactQuerySqlContext [branch=" + branchId + "(" + super.toString() + ")]";
+ return "ArtifactQuerySqlContext [branch=" + branch + "(" + super.toString() + ")]";
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImpl.java
index 3591d57e79f..70069732044 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImpl.java
@@ -14,6 +14,7 @@ import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import java.util.List;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.HasBranch;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
@@ -70,19 +71,19 @@ public class ArtifactQuerySqlContextFactoryImpl implements QuerySqlContextFactor
}
private QuerySqlContext createContext(OrcsSession session, QueryData queryData) throws OseeCoreException {
- Long branch = getBranchToSearch(queryData);
+ BranchId branch = getBranchToSearch(queryData);
Conditions.checkNotNull(branch, "branch");
return new ArtifactQuerySqlContext(session, branch, queryData.getOptions());
}
private AbstractSqlWriter createQueryWriter(SqlContext context, QueryData queryData, QueryType queryType) throws OseeCoreException {
- Long branch = getBranchToSearch(queryData);
+ BranchId branch = getBranchToSearch(queryData);
Conditions.checkNotNull(branch, "branch");
return new ArtifactQuerySqlWriter(logger, joinFactory, jdbcClient, context, queryType, branch);
}
- private Long getBranchToSearch(QueryData queryData) throws OseeCoreException {
- Long branch = null;
+ private BranchId getBranchToSearch(QueryData queryData) throws OseeCoreException {
+ BranchId branch = BranchId.SENTINEL;
Iterable<? extends Criteria> criterias = queryData.getAllCriteria();
Optional<? extends Criteria> item = Iterables.tryFind(criterias, new Predicate<Criteria>() {
@@ -95,9 +96,8 @@ public class ArtifactQuerySqlContextFactoryImpl implements QuerySqlContextFactor
});
if (item.isPresent()) {
HasBranch criteria = (HasBranch) item.get();
- branch = criteria.getBranchId();
+ branch = criteria.getBranch();
}
return branch;
}
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlWriter.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlWriter.java
index 713c732eae7..6224633a730 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlWriter.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlWriter.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.orcs.db.internal.search.engines;
import org.eclipse.osee.framework.core.enums.ModificationType;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.TxChange;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -30,11 +31,11 @@ import org.eclipse.osee.orcs.db.internal.sql.join.SqlJoinFactory;
*/
public class ArtifactQuerySqlWriter extends AbstractSqlWriter {
- private final long branchUuid;
+ private final BranchId branch;
- public ArtifactQuerySqlWriter(Log logger, SqlJoinFactory joinFactory, JdbcClient jdbcClient, SqlContext context, QueryType queryType, long branchUuid) {
+ public ArtifactQuerySqlWriter(Log logger, SqlJoinFactory joinFactory, JdbcClient jdbcClient, SqlContext context, QueryType queryType, BranchId branch) {
super(logger, joinFactory, jdbcClient, context, queryType);
- this.branchUuid = branchUuid;
+ this.branch = branch;
}
private void writeSelectHelper() throws OseeCoreException {
@@ -86,11 +87,11 @@ public class ArtifactQuerySqlWriter extends AbstractSqlWriter {
StringBuilder sb = new StringBuilder();
writeTxFilter(txsAlias, sb, allowDeleted);
- if (branchUuid > 0) {
+ if (branch.isValid()) {
sb.append(" AND ");
sb.append(txsAlias);
sb.append(".branch_id = ?");
- addParameter(branchUuid);
+ addParameter(branch);
} else {
throw new OseeArgumentException("getTxBranchFilter: branch uuid must be > 0");
}
@@ -101,11 +102,11 @@ public class ArtifactQuerySqlWriter extends AbstractSqlWriter {
public String getTxBranchFilter(String txsAlias, boolean allowDeleted) {
StringBuilder sb = new StringBuilder();
writeTxFilter(txsAlias, sb, allowDeleted);
- if (branchUuid > 0) {
+ if (branch.isValid()) {
sb.append(" AND ");
sb.append(txsAlias);
sb.append(".branch_id = ?");
- addParameter(branchUuid);
+ addParameter(branch);
}
return sb.toString();
}
@@ -150,13 +151,13 @@ public class ArtifactQuerySqlWriter extends AbstractSqlWriter {
addParameter(OptionsUtil.getFromTransaction(getOptions()));
}
}
- if (branchUuid > 0) {
+ if (branch.isValid()) {
if (sb.length() > 0) {
sb.append(" AND ");
}
sb.append(txsAlias);
sb.append(".branch_id = ?");
- addParameter(branchUuid);
+ addParameter(branch);
}
return sb.toString();
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/handlers/MergeBranchForSqlHandler.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/handlers/MergeBranchForSqlHandler.java
index 51c292bb011..9aaa22ee960 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/handlers/MergeBranchForSqlHandler.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/handlers/MergeBranchForSqlHandler.java
@@ -50,10 +50,10 @@ public class MergeBranchForSqlHandler extends SqlHandler<CriteriaMergeBranchFor>
@Override
public boolean addPredicates(AbstractSqlWriter writer) throws OseeCoreException {
writer.write("%s.source_branch_id = ?", mergeAlias);
- writer.addParameter(criteria.getSourceUuid());
+ writer.addParameter(criteria.getSource());
writer.writeAndLn();
writer.write("%s.dest_branch_id = ?", mergeAlias);
- writer.addParameter(criteria.getDestUuid());
+ writer.addParameter(criteria.getDestination());
writer.writeAndLn();
writer.write("%s.merge_branch_id = %s.branch_id", mergeAlias, brAlias);
return true;
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/handlers/TxGetHeadSqlHandler.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/handlers/TxGetHeadSqlHandler.java
index 32bb54b4caf..5492a3bf962 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/handlers/TxGetHeadSqlHandler.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/handlers/TxGetHeadSqlHandler.java
@@ -51,8 +51,7 @@ public class TxGetHeadSqlHandler extends SqlHandler<CriteriaTxGetHead> {
writer.write(" WHERE ");
writer.write("branch_id = ?)");
- long branch = criteria.getBranchid();
- writer.addParameter(branch);
+ writer.addParameter(criteria.getBranch());
return true;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/ArtifactJoinQuery.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/ArtifactJoinQuery.java
index 2d241fe38bd..2b3599d9d7f 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/ArtifactJoinQuery.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/ArtifactJoinQuery.java
@@ -113,8 +113,4 @@ public class ArtifactJoinQuery extends AbstractJoinQuery {
throw new OseeDataStoreException("Exceeded max artifact join size of [%d]", maxJoinSize);
}
}
-
- public void add(Integer art_id, Long branchUuid) {
- add(art_id, branchUuid, null);
- }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/CommitTransactionDatabaseTxCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/CommitTransactionDatabaseTxCallable.java
index f930d43718b..fd4a5dc2229 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/CommitTransactionDatabaseTxCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/CommitTransactionDatabaseTxCallable.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.orcs.db.internal.transaction;
import java.util.Date;
import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.enums.BranchState;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
@@ -74,11 +75,11 @@ public final class CommitTransactionDatabaseTxCallable extends AbstractDatastore
// TODO:
// 1. Make this whole method a critical region on a per branch basis - can only write to a branch on one thread at time
String comment = transactionData.getComment();
- Long branchId = transactionData.getBranchId();
+ BranchId branch = transactionData.getBranch();
ArtifactId author = transactionData.getAuthor();
OrcsChangeSet changeSet = transactionData.getChangeSet();
- Conditions.checkNotNull(branchId, "branch");
+ Conditions.checkNotNull(branch, "branch");
Conditions.checkNotNull(author, "transaction author");
Conditions.checkNotNullOrEmpty(comment, "transaction comment");
TransactionResult result = null;
@@ -86,10 +87,10 @@ public final class CommitTransactionDatabaseTxCallable extends AbstractDatastore
process(TxWritePhaseEnum.BEFORE_TX_WRITE);
- TransactionReadable txRecord = createTransactionRecord(branchId, author, comment, getNextTransactionId());
+ TransactionReadable txRecord = createTransactionRecord(branch, author, comment, getNextTransactionId());
writer.write(connection, txRecord, changeSet);
- Object[] params = new Object[] {BranchState.MODIFIED.getValue(), branchId, BranchState.CREATED.getValue()};
+ Object[] params = new Object[] {BranchState.MODIFIED.getValue(), branch, BranchState.CREATED.getValue()};
getJdbcClient().runPreparedUpdate(connection, UPDATE_BRANCH_STATE, params);
result = new TransactionResultImpl(txRecord, changeSet);
@@ -109,14 +110,14 @@ public final class CommitTransactionDatabaseTxCallable extends AbstractDatastore
process(TxWritePhaseEnum.AFTER_TX_WRITE);
}
- private TransactionReadable createTransactionRecord(Long branchId, ArtifactId author, String comment, TransactionId transaction) throws OseeCoreException {
+ private TransactionReadable createTransactionRecord(BranchId branch, ArtifactId author, String comment, TransactionId transaction) throws OseeCoreException {
TransactionDetailsType txType = TransactionDetailsType.NonBaselined;
Date transactionTime = GlobalTime.GreenwichMeanTimestamp();
TransactionDataImpl created = new TransactionDataImpl(transaction.getId());
created.setAuthor(author);
- created.setBranchId(branchId);
+ created.setBranch(branch);
created.setComment(comment);
created.setCommitArt(ArtifactId.SENTINEL);
created.setDate(transactionTime);
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/ComodificationCheck.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/ComodificationCheck.java
index c524771048a..33e0c860010 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/ComodificationCheck.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/ComodificationCheck.java
@@ -47,7 +47,7 @@ public class ComodificationCheck implements TransactionProcessor {
txData.getChangeSet().accept(checker);
if (!checker.getArtifactIds().isEmpty()) {
- DataLoader loader = dataLoader.newDataLoaderFromIds(session, txData.getBranchId(), checker.getArtifactIds());
+ DataLoader loader = dataLoader.newDataLoaderFromIds(session, txData.getBranch(), checker.getArtifactIds());
loader.withAttributeIds(checker.getAttributeIds());
loader.withRelationIds(checker.getRelationIds());
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriter.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriter.java
index 9ea98d29fc1..0ec4ea35aff 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriter.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriter.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.orcs.db.internal.transaction;
import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.TxChange;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.jdbc.JdbcClient;
@@ -136,10 +137,9 @@ public class TransactionWriter {
}
sqlBuilder.updateAfterBinaryStorePersist();
- long branchUuid = tx.getBranchId();
List<Object[]> txNotCurrentData = new ArrayList<>();
for (Entry<SqlOrderEnum, ? extends AbstractJoinQuery> entry : sqlBuilder.getTxNotCurrents()) {
- fetchTxNotCurrent(connection, branchUuid, txNotCurrentData, entry.getKey().getTxsNotCurrentQuery(),
+ fetchTxNotCurrent(connection, tx.getBranch(), txNotCurrentData, entry.getKey().getTxsNotCurrentQuery(),
entry.getValue());
}
@@ -156,14 +156,14 @@ public class TransactionWriter {
}
}
- private void fetchTxNotCurrent(JdbcConnection connection, long branchUuid, List<Object[]> results, String query, AbstractJoinQuery join) throws OseeCoreException {
+ private void fetchTxNotCurrent(JdbcConnection connection, BranchId branch, List<Object[]> results, String query, AbstractJoinQuery join) throws OseeCoreException {
try {
join.store();
JdbcStatement chStmt = jdbcClient.getStatement(connection);
try {
- chStmt.runPreparedQuery(query, join.getQueryId(), branchUuid);
+ chStmt.runPreparedQuery(query, join.getQueryId(), branch);
while (chStmt.next()) {
- results.add(new Object[] {branchUuid, chStmt.getLong("transaction_id"), chStmt.getLong("gamma_id")});
+ results.add(new Object[] {branch, chStmt.getLong("transaction_id"), chStmt.getLong("gamma_id")});
}
} finally {
chStmt.close();
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderImpl.java
index 2eb654ff9f6..2da021ea2b8 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderImpl.java
@@ -92,7 +92,7 @@ public class TxSqlBuilderImpl implements OrcsVisitor, TxSqlBuilder {
dataItemInserts = new HashCollection<>();
txNotCurrentsJoin = new HashMap<>();
- addRow(SqlOrderEnum.TXS_DETAIL, txId, tx.getComment(), tx.getDate(), tx.getAuthor(), tx.getBranchId(),
+ addRow(SqlOrderEnum.TXS_DETAIL, txId, tx.getComment(), tx.getDate(), tx.getAuthor(), tx.getBranch(),
tx.getTxType().getId());
changeSet.accept(this);
}
@@ -195,7 +195,7 @@ public class TxSqlBuilderImpl implements OrcsVisitor, TxSqlBuilder {
ModificationType modType = orcsData.getModType();
addRow(SqlOrderEnum.TXS, data.getTransactionId(), data.getGammaId(), modType.getValue(),
- TxChange.getCurrent(modType).getValue(), data.getBranchId(), orcsData.getApplicabilityId());
+ TxChange.getCurrent(modType).getValue(), data.getBranch(), orcsData.getApplicabilityId());
if (key.hasTxNotCurrentQuery()) {
IdJoinQuery join = txNotCurrentsJoin.get(key);
diff --git a/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/BranchEndpoint.java b/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/BranchEndpoint.java
index 1a52b29f7d5..efc115b69b8 100644
--- a/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/BranchEndpoint.java
+++ b/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/BranchEndpoint.java
@@ -24,6 +24,7 @@ import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
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;
import org.eclipse.osee.framework.core.model.change.CompareResults;
@@ -53,14 +54,14 @@ public interface BranchEndpoint {
@GET
@Produces(MediaType.APPLICATION_JSON)
List<Branch> getBranches(@DefaultValue("") @QueryParam("branchUuids") String branchUuids, //
- @DefaultValue("") @QueryParam("branchTypes") String branchTypes, //
- @DefaultValue("") @QueryParam("branchStates") String branchStates, //
- @QueryParam("deleted") boolean deleted, //
- @QueryParam("archived") boolean archived, //
- @DefaultValue("") @QueryParam("nameEquals") String nameEquals, //
- @DefaultValue("") @QueryParam("namePattern") String namePattern, //
- @QueryParam("childOf") Long childOf, //
- @QueryParam("ancestorOf") Long ancestorOf);
+ @DefaultValue("") @QueryParam("branchTypes") String branchTypes, //
+ @DefaultValue("") @QueryParam("branchStates") String branchStates, //
+ @QueryParam("deleted") boolean deleted, //
+ @QueryParam("archived") boolean archived, //
+ @DefaultValue("") @QueryParam("nameEquals") String nameEquals, //
+ @DefaultValue("") @QueryParam("namePattern") String namePattern, //
+ @QueryParam("childOf") Long childOf, //
+ @QueryParam("ancestorOf") Long ancestorOf);
@GET
@Path("baseline")
@@ -73,24 +74,24 @@ public interface BranchEndpoint {
List<Branch> getWorkingBranches();
@GET
- @Path("{branch-uuid}")
+ @Path("{branch}")
@Produces({MediaType.APPLICATION_JSON})
- Branch getBranch(@PathParam("branch-uuid") long branchUuid);
+ Branch getBranch(@PathParam("branch") BranchId branch);
@GET
- @Path("{branch-uuid}/diff/{branch-uuid2}")
+ @Path("{branch1}/diff/{branch2}")
@Produces({MediaType.APPLICATION_JSON})
- CompareResults compareBranches(@PathParam("branch-uuid") long branchUuid, @PathParam("branch-uuid2") long branchUuid2);
+ CompareResults compareBranches(@PathParam("branch1") BranchId branch1, @PathParam("branch2") BranchId branch2);
@GET
- @Path("{branch-uuid}/txs")
+ @Path("{branch}/txs")
@Produces({MediaType.APPLICATION_JSON})
- List<Transaction> getAllBranchTxs(@PathParam("branch-uuid") long branchUuid);
+ List<Transaction> getAllBranchTxs(@PathParam("branch") BranchId branch);
@GET
- @Path("{branch-uuid}/txs/{tx-id}")
+ @Path("{branch}/txs/{tx-id}")
@Produces({MediaType.APPLICATION_JSON})
- Transaction getBranchTx(@PathParam("branch-uuid") long branchUuid, @PathParam("tx-id") int txId);
+ Transaction getBranchTx(@PathParam("branch") BranchId branch, @PathParam("tx-id") int txId);
@POST
@Consumes(MediaType.APPLICATION_JSON)
@@ -103,26 +104,26 @@ public interface BranchEndpoint {
Response createBranch(NewBranch data);
@POST
- @Path("{branch-uuid}")
+ @Path("{branch}")
@Consumes({MediaType.APPLICATION_JSON})
@Produces({MediaType.APPLICATION_JSON})
- Response createBranchWithId(@PathParam("branch-uuid") long branchUuid, NewBranch data);
+ Response createBranchWithId(@PathParam("branch") BranchId branch, NewBranch data);
@POST
- @Path("{branch-uuid}/commit/{destination-branch-uuid}")
+ @Path("{branch}/commit/{destination-branch}")
@Consumes({MediaType.APPLICATION_JSON})
@Produces({MediaType.APPLICATION_JSON})
- Response commitBranch(@PathParam("branch-uuid") long branchUuid, @PathParam("destination-branch-uuid") long destinationBranchUuid, BranchCommitOptions options);
+ Response commitBranch(@PathParam("branch") BranchId branch, @PathParam("destination-branch") BranchId destinationBranch, BranchCommitOptions options);
@POST
- @Path("{branch-uuid}/archive")
- Response archiveBranch(@PathParam("branch-uuid") long branchUuid);
+ @Path("{branch}/archive")
+ Response archiveBranch(@PathParam("branch") BranchId branch);
@POST
- @Path("{branch-uuid}/txs")
+ @Path("{branch}/txs")
@Consumes({MediaType.APPLICATION_JSON})
@Produces({MediaType.APPLICATION_JSON})
- Response writeTx(@PathParam("branch-uuid") long branchUuid, NewTransaction data);
+ Response writeTx(@PathParam("branch") BranchId branch, NewTransaction data);
@POST
@Path("exchange/validation")
@@ -143,46 +144,46 @@ public interface BranchEndpoint {
Response deleteBranchExchange(@QueryParam("path") String path);
@PUT
- @Path("{branch-uuid}/name/{branch-name}")
- Response setBranchName(@PathParam("branch-uuid") long branchUuid, @PathParam("branch-name") String newName);
+ @Path("{branch}/name/{branch-name}")
+ Response setBranchName(@PathParam("branch") BranchId branch, @PathParam("branch-name") String newName);
@PUT
- @Path("{branch-uuid}/type/{branch-type}")
- Response setBranchType(@PathParam("branch-uuid") long branchUuid, @PathParam("branch-type") BranchType newType);
+ @Path("{branch}/type/{branch-type}")
+ Response setBranchType(@PathParam("branch") BranchId branch, @PathParam("branch-type") BranchType newType);
@PUT
- @Path("{branch-uuid}/state/{branch-state}")
- Response setBranchState(@PathParam("branch-uuid") long branchUuid, @PathParam("branch-state") BranchState newState);
+ @Path("{branch}/state/{branch-state}")
+ Response setBranchState(@PathParam("branch") BranchId branch, @PathParam("branch-state") BranchState newState);
@PUT
- @Path("{branch-uuid}/associated-artifact/{art-id}")
- Response associateBranchToArtifact(@PathParam("branch-uuid") long branchUuid, @PathParam("art-id") ArtifactId artifact);
+ @Path("{branch}/associated-artifact/{art-id}")
+ Response associateBranchToArtifact(@PathParam("branch") BranchId branch, @PathParam("art-id") ArtifactId artifact);
@PUT
- @Path("{branch-uuid}/txs/{tx-id}/comment/{tx-comment}")
- Response setTxComment(@PathParam("branch-uuid") long branchUuid, @PathParam("tx-id") int txId, @PathParam("tx-comment") String comment);
+ @Path("{branch}/txs/{tx-id}/comment/{tx-comment}")
+ Response setTxComment(@PathParam("branch") BranchId branch, @PathParam("tx-id") int txId, @PathParam("tx-comment") String comment);
@DELETE
- @Path("{branch-uuid}")
- Response purgeBranch(@PathParam("branch-uuid") long branchUuid, @DefaultValue("false") @QueryParam("recurse") boolean recurse);
+ @Path("{branch}")
+ Response purgeBranch(@PathParam("branch") BranchId branch, @DefaultValue("false") @QueryParam("recurse") boolean recurse);
@DELETE
- @Path("{branch-uuid}/associated-artifact")
- Response unassociateBranch(@PathParam("branch-uuid") long branchUuid);
+ @Path("{branch}/associated-artifact")
+ Response unassociateBranch(@PathParam("branch") BranchId branch);
@DELETE
- @Path("{branch-uuid}/commit/{destination-branch-uuid}")
+ @Path("{branch}/commit/{destination-branch}")
@Produces({MediaType.APPLICATION_JSON})
- Response unCommitBranch(@PathParam("branch-uuid") long branchUuid, @PathParam("destination-branch-uuid") long destinationBranchUuid);
+ Response unCommitBranch(@PathParam("branch") BranchId branch, @PathParam("destination-branch") BranchId destinationBranch);
@DELETE
- @Path("{branch-uuid}/archive")
+ @Path("{branch}/archive")
@Produces({MediaType.APPLICATION_JSON})
- Response unarchiveBranch(@PathParam("branch-uuid") long branchUuid);
+ Response unarchiveBranch(@PathParam("branch") BranchId branch);
@DELETE
- @Path("{branch-uuid}/txs/{tx-ids}")
- Response purgeTxs(@PathParam("branch-uuid") long branchUuid, @PathParam("tx-ids") String txIds);
+ @Path("{branch}/txs/{tx-ids}")
+ Response purgeTxs(@PathParam("branch") BranchId branch, @PathParam("tx-ids") String txIds);
@PUT
@Path("log/{comment}")
diff --git a/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsCollectorValidatorTest.java b/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsCollectorValidatorTest.java
index 70a23fb296f..b04fcfbc97e 100644
--- a/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsCollectorValidatorTest.java
+++ b/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsCollectorValidatorTest.java
@@ -10,10 +10,12 @@
*******************************************************************************/
package org.eclipse.osee.orcs.rest.internal.writer;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.when;
import java.util.Arrays;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.util.XResultData;
import org.eclipse.osee.orcs.rest.model.writer.reader.OwArtifact;
import org.eclipse.osee.orcs.rest.model.writer.reader.OwArtifactToken;
@@ -83,7 +85,7 @@ public class OrcsCollectorValidatorTest {
@Test
public void test_validateArtifactDoesNotExist() {
- when(helper.isBranchExists(570)).thenReturn(true);
+ when(helper.isBranchExists(COMMON)).thenReturn(true);
XResultData rd = validator.run();
assertFalse(rd.toString().contains("Branch [OwBranch [uuid=570]] not valid."));
@@ -94,7 +96,7 @@ public class OrcsCollectorValidatorTest {
artifact.setType(artType);
artifact.setUuid(5555L);
- when(helper.isArtifactExists(570, 5555L)).thenReturn(false);
+ when(helper.isArtifactExists(COMMON, 5555L)).thenReturn(false);
when(collector.getCreate()).thenReturn(Arrays.asList(artifact));
rd = validator.run();
assertTrue(rd.toString().contains("Artifact Type [OwArtifactType [uuid=11, data=null]] does not exist."));
@@ -109,7 +111,7 @@ public class OrcsCollectorValidatorTest {
@Test
public void test_validateCreateAttributes() {
- when(helper.isBranchExists(570)).thenReturn(true);
+ when(helper.isBranchExists(COMMON)).thenReturn(true);
XResultData rd = validator.run();
assertFalse(rd.toString().contains("Branch [OwBranch [uuid=570]] not valid."));
@@ -152,7 +154,7 @@ public class OrcsCollectorValidatorTest {
@Test
public void test_validateCreateRelations() {
- when(helper.isBranchExists(570)).thenReturn(true);
+ when(helper.isBranchExists(COMMON)).thenReturn(true);
XResultData rd = validator.run();
assertFalse(rd.toString().contains("Branch [OwBranch [uuid=570]] not valid."));
@@ -187,7 +189,7 @@ public class OrcsCollectorValidatorTest {
assertTrue(rd.toString().contains(
"Artifact from token [OwArtifactToken [uuid=9999, data=null]] does not exist to relate to artifact [OwArtifact [type=OwArtifactType [uuid=11, data=null], uuid=5555, data=null]] for relation [OwRelation [type=OwRelationType [sideA=false, sideName=null, uuid=65656, data=null], artToken=OwArtifactToken [uuid=9999, data=null], data=null]]."));
- when(helper.isArtifactExists(collector.getBranch().getUuid(), 9999)).thenReturn(true);
+ when(helper.isArtifactExists(BranchId.valueOf(collector.getBranch().getUuid()), 9999)).thenReturn(true);
rd = validator.run();
assertFalse(rd.toString().contains(
"Artifact from token [OwArtifactToken [uuid=9999, data=null]] does not exist to relate to artifact [OwArtifact [type=OwArtifactType [uuid=11, data=null], uuid=5555, data=null]] for relation [OwRelation [type=OwRelationType [sideA=false, sideName=null, uuid=65656, data=null], artToken=OwArtifactToken [uuid=9999, data=null], data=null]]."));
@@ -207,11 +209,11 @@ public class OrcsCollectorValidatorTest {
@Test
public void test_branch() {
- when(helper.isBranchExists(570)).thenReturn(false);
+ when(helper.isBranchExists(COMMON)).thenReturn(false);
XResultData rd = validator.run();
assertTrue(rd.toString().contains("Branch [OwBranch [uuid=570]] not valid."));
- when(helper.isBranchExists(570)).thenReturn(true);
+ when(helper.isBranchExists(COMMON)).thenReturn(true);
rd = validator.run();
assertFalse(rd.toString().contains("Branch [OwBranch [uuid=570]] not valid."));
}
diff --git a/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsValidationHelperAdapterTest.java b/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsValidationHelperAdapterTest.java
index cfd7e83b3e6..c63c1fad3aa 100644
--- a/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsValidationHelperAdapterTest.java
+++ b/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsValidationHelperAdapterTest.java
@@ -10,7 +10,8 @@
*******************************************************************************/
package org.eclipse.osee.orcs.rest.internal.writer;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
@@ -54,9 +55,9 @@ public class OrcsValidationHelperAdapterTest {
@Test
public void testIsBranchExists() {
- Assert.assertTrue(helper.isBranchExists(COMMON_ID));
+ Assert.assertTrue(helper.isBranchExists(COMMON));
- Assert.assertFalse(helper.isBranchExists(34598L));
+ Assert.assertFalse(helper.isBranchExists(BranchId.valueOf(34598)));
}
@Test
@@ -68,11 +69,11 @@ public class OrcsValidationHelperAdapterTest {
@Test
public void testIsArtifactExists() {
- ArtifactReadable artifact = orcsApi.getQueryFactory().fromBranch(COMMON_ID).andIsOfType(
+ ArtifactReadable artifact = orcsApi.getQueryFactory().fromBranch(COMMON).andIsOfType(
CoreArtifactTypes.User).getResults().iterator().next();
- Assert.assertTrue(helper.isArtifactExists(COMMON_ID, artifact.getUuid()));
+ Assert.assertTrue(helper.isArtifactExists(COMMON, artifact.getUuid()));
- Assert.assertFalse(helper.isArtifactExists(COMMON_ID, 999999L));
+ Assert.assertFalse(helper.isArtifactExists(COMMON, 999999L));
}
@Test
diff --git a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/BranchEndpointImpl.java b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/BranchEndpointImpl.java
index e56c21bf681..0ff7a6a8212 100644
--- a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/BranchEndpointImpl.java
+++ b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/BranchEndpointImpl.java
@@ -53,7 +53,6 @@ import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.framework.jdk.core.util.Compare;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -138,16 +137,16 @@ public class BranchEndpointImpl implements BranchEndpoint {
return orcsApi.getBranchOps();
}
- private BranchReadable getBranchById(long branchUuid) {
- ResultSet<BranchReadable> results = newBranchQuery().andUuids(branchUuid)//
+ private BranchReadable getBranchById(BranchId branch) {
+ ResultSet<BranchReadable> results = newBranchQuery().andIds(branch)//
.includeArchived()//
.includeDeleted()//
.getResults();
return results.getExactlyOne();
}
- private TransactionReadable getTxByBranchAndId(long branchUuid, int txId) {
- return newTxQuery().andBranchIds(branchUuid).andTxId(txId).getResults().getExactlyOne();
+ private TransactionReadable getTxByBranchAndId(BranchId branch, int txId) {
+ return newTxQuery().andBranch(branch).andTxId(txId).getResults().getExactlyOne();
}
private TransactionFactory newTxFactory() {
@@ -238,23 +237,22 @@ public class BranchEndpointImpl implements BranchEndpoint {
}
@Override
- public Branch getBranch(long branchUuid) {
- BranchReadable branch = getBranchById(branchUuid);
- return asBranch(branch);
+ public Branch getBranch(BranchId branch) {
+ return asBranch(getBranchById(branch));
}
@Override
- public List<Transaction> getAllBranchTxs(long branchUuid) {
- return asTransactions(newTxQuery().andBranchIds(branchUuid).getResults());
+ public List<Transaction> getAllBranchTxs(BranchId branch) {
+ return asTransactions(newTxQuery().andBranch(branch).getResults());
}
@Override
- public Transaction getBranchTx(long branchUuid, int txId) {
+ public Transaction getBranchTx(BranchId branchUuid, int txId) {
return asTransaction(getTxByBranchAndId(branchUuid, txId));
}
@Override
- public CompareResults compareBranches(long branchUuid, long branchUuid2) {
+ public CompareResults compareBranches(BranchId branchUuid, BranchId branchUuid2) {
TransactionToken sourceTx = newTxQuery().andIsHead(branchUuid).getResults().getExactlyOne();
TransactionToken destinationTx = newTxQuery().andIsHead(branchUuid2).getResults().getExactlyOne();
@@ -275,18 +273,16 @@ public class BranchEndpointImpl implements BranchEndpoint {
@Override
public Response createBranch(NewBranch data) {
- long branchUuid = Lib.generateUuid();
- return createBranchWithId(branchUuid, data);
+ return createBranchWithId(TokenFactory.createBranch(), data);
}
@Override
- public Response createBranchWithId(long branchUuid, NewBranch data) {
- if (branchUuid <= 0) {
- throw new OseeWebApplicationException(Status.BAD_REQUEST, "branchUuid [%d] uuid must be > 0", branchUuid);
+ public Response createBranchWithId(BranchId branch, NewBranch data) {
+ if (branch.isInvalid()) {
+ throw new OseeWebApplicationException(Status.BAD_REQUEST, "branchUuid [%d] uuid must be > 0", branch);
}
- CreateBranchData createData = new CreateBranchData();
- createData.setUuid(branchUuid);
+ CreateBranchData createData = new CreateBranchData(branch);
createData.setName(data.getBranchName());
createData.setBranchType(data.getBranchType());
createData.setCreationComment(data.getCreationComment());
@@ -312,7 +308,7 @@ public class BranchEndpointImpl implements BranchEndpoint {
activityLog.createEntry(Activity.BRANCH_OPERATION, ActivityLog.INITIAL_STATUS,
String.format(
"Branch Operation Create Branch {branchUUID: %s, branchName: %s accountId: %s serverId: %s clientId: %s}",
- branchUuid, data.getBranchName(), RestUtil.getAccountId(httpHeaders), RestUtil.getServerId(httpHeaders),
+ branch, data.getBranchName(), RestUtil.getAccountId(httpHeaders), RestUtil.getServerId(httpHeaders),
RestUtil.getClientId(httpHeaders)));
} catch (OseeCoreException ex) {
OseeLog.log(ActivityLog.class, OseeLevel.SEVERE_POPUP, ex);
@@ -346,9 +342,9 @@ public class BranchEndpointImpl implements BranchEndpoint {
}
@Override
- public Response commitBranch(long branchUuid, long destinationBranchUuid, BranchCommitOptions options) {
- BranchReadable srcBranch = getBranchById(branchUuid);
- BranchReadable destBranch = getBranchById(destinationBranchUuid);
+ public Response commitBranch(BranchId branch, BranchId destinationBranch, BranchCommitOptions options) {
+ BranchReadable srcBranch = getBranchById(branch);
+ BranchReadable destBranch = getBranchById(destinationBranch);
Callable<TransactionToken> op = getBranchOps().commitBranch(options.getCommitter(), srcBranch, destBranch);
TransactionToken tx = executeCallable(op);
@@ -363,8 +359,8 @@ public class BranchEndpointImpl implements BranchEndpoint {
try {
activityLog.createEntry(Activity.BRANCH_OPERATION, ActivityLog.INITIAL_STATUS,
String.format(
- "Branch Operation Commit Branch {branchUUID: %s srcBranch: %s destBranch: %s accountId: %s serverId: %s clientId: %s}",
- branchUuid, srcBranch, destBranch, RestUtil.getAccountId(httpHeaders), RestUtil.getServerId(httpHeaders),
+ "Branch Operation Commit Branch {branchId: %s srcBranch: %s destBranch: %s accountId: %s serverId: %s clientId: %s}",
+ branch, srcBranch, destBranch, RestUtil.getAccountId(httpHeaders), RestUtil.getServerId(httpHeaders),
RestUtil.getClientId(httpHeaders)));
} catch (OseeCoreException ex) {
OseeLog.log(ActivityLog.class, OseeLevel.SEVERE_POPUP, ex);
@@ -379,8 +375,8 @@ public class BranchEndpointImpl implements BranchEndpoint {
}
@Override
- public Response archiveBranch(long branchUuid) {
- BranchReadable branch = getBranchById(branchUuid);
+ public Response archiveBranch(BranchId branchId) {
+ BranchReadable branch = getBranchById(branchId);
boolean modified = false;
BranchArchivedState currentState = branch.getArchiveState();
@@ -390,8 +386,8 @@ public class BranchEndpointImpl implements BranchEndpoint {
modified = true;
try {
activityLog.createEntry(Activity.BRANCH_OPERATION, ActivityLog.INITIAL_STATUS,
- String.format("Branch Operation Archive Branch {branchUUID: %s accountId: %s serverId: %s clientId: %s}",
- branchUuid, RestUtil.getAccountId(httpHeaders), RestUtil.getServerId(httpHeaders),
+ String.format("Branch Operation Archive Branch {branchId: %s accountId: %s serverId: %s clientId: %s}",
+ branchId, RestUtil.getAccountId(httpHeaders), RestUtil.getServerId(httpHeaders),
RestUtil.getClientId(httpHeaders)));
} catch (OseeCoreException ex) {
OseeLog.log(ActivityLog.class, OseeLevel.SEVERE_POPUP, ex);
@@ -401,12 +397,12 @@ public class BranchEndpointImpl implements BranchEndpoint {
}
@Override
- public Response writeTx(long branchUuid, NewTransaction data) {
+ public Response writeTx(BranchId branch, NewTransaction data) {
String comment = data.getComment();
ArtifactReadable userArtifact = null;
TransactionFactory txFactory = newTxFactory();
- TransactionBuilder txBuilder = txFactory.createTransaction(branchUuid, userArtifact, comment);
+ TransactionBuilder txBuilder = txFactory.createTransaction(branch, userArtifact, comment);
//TODO: Integrate data with TxBuilder
@@ -577,8 +573,8 @@ public class BranchEndpointImpl implements BranchEndpoint {
}
@Override
- public Response setBranchName(long branchUuid, String newName) {
- BranchReadable branch = getBranchById(branchUuid);
+ public Response setBranchName(BranchId branchId, String newName) {
+ BranchReadable branch = getBranchById(branchId);
boolean modified = false;
if (isDifferent(branch.getName(), newName)) {
Callable<?> op = getBranchOps().changeBranchName(branch, newName);
@@ -587,8 +583,8 @@ public class BranchEndpointImpl implements BranchEndpoint {
try {
activityLog.createEntry(Activity.BRANCH_OPERATION, ActivityLog.INITIAL_STATUS,
String.format(
- "Branch Operation Set Branch Name {branchUUID: %s prevName: %s newName: %s accountId: %s serverId: %s clientId: %s}",
- branchUuid, branch.getName(), newName, RestUtil.getAccountId(httpHeaders),
+ "Branch Operation Set Branch Name {branchId: %s prevName: %s newName: %s accountId: %s serverId: %s clientId: %s}",
+ branchId, branch.getName(), newName, RestUtil.getAccountId(httpHeaders),
RestUtil.getServerId(httpHeaders), RestUtil.getClientId(httpHeaders)));
} catch (OseeCoreException ex) {
OseeLog.log(ActivityLog.class, OseeLevel.SEVERE_POPUP, ex);
@@ -598,15 +594,15 @@ public class BranchEndpointImpl implements BranchEndpoint {
}
@Override
- public Response setBranchType(long branchUuid, BranchType newType) {
- BranchReadable branch = getBranchById(branchUuid);
+ public Response setBranchType(BranchId branchId, BranchType newType) {
+ BranchReadable branch = getBranchById(branchId);
boolean modified = false;
if (isDifferent(branch.getBranchType(), newType)) {
try {
activityLog.createEntry(Activity.BRANCH_OPERATION, ActivityLog.INITIAL_STATUS,
String.format(
"Branch Operation Set Branch Type {branchUUID: %s prevType: %s newType: %s accountId: %s serverId: %s clientId: %s}",
- branchUuid, branch.getBranchType(), newType, RestUtil.getAccountId(httpHeaders),
+ branchId, branch.getBranchType(), newType, RestUtil.getAccountId(httpHeaders),
RestUtil.getServerId(httpHeaders), RestUtil.getClientId(httpHeaders)));
} catch (OseeCoreException ex) {
OseeLog.log(ActivityLog.class, OseeLevel.SEVERE_POPUP, ex);
@@ -619,8 +615,8 @@ public class BranchEndpointImpl implements BranchEndpoint {
}
@Override
- public Response setBranchState(long branchUuid, BranchState newState) {
- BranchReadable branch = getBranchById(branchUuid);
+ public Response setBranchState(BranchId branchId, BranchState newState) {
+ BranchReadable branch = getBranchById(branchId);
boolean modified = false;
if (isDifferent(branch.getBranchState(), newState)) {
Callable<?> op = getBranchOps().changeBranchState(branch, newState);
@@ -630,8 +626,8 @@ public class BranchEndpointImpl implements BranchEndpoint {
try {
activityLog.createEntry(Activity.BRANCH_OPERATION, ActivityLog.INITIAL_STATUS,
String.format(
- "Branch Operation Branch State Changed {branchUUID: %s prevState: %s newState: %s accountId: %s serverId: %s clientId: %s}",
- branchUuid, branch.getBranchType(), newState, RestUtil.getAccountId(httpHeaders),
+ "Branch Operation Branch State Changed {branchId: %s prevState: %s newState: %s accountId: %s serverId: %s clientId: %s}",
+ branchId, branch.getBranchType(), newState, RestUtil.getAccountId(httpHeaders),
RestUtil.getServerId(httpHeaders), RestUtil.getClientId(httpHeaders)));
} catch (OseeCoreException ex) {
OseeLog.log(ActivityLog.class, OseeLevel.SEVERE_POPUP, ex);
@@ -641,15 +637,15 @@ public class BranchEndpointImpl implements BranchEndpoint {
}
@Override
- public Response associateBranchToArtifact(long branchUuid, ArtifactId artifact) {
- BranchReadable branch = getBranchById(branchUuid);
+ public Response associateBranchToArtifact(BranchId branchId, ArtifactId artifact) {
+ BranchReadable branch = getBranchById(branchId);
boolean modified = false;
if (isDifferent(branch.getAssociatedArtifact(), artifact)) {
try {
activityLog.createEntry(Activity.BRANCH_OPERATION, ActivityLog.INITIAL_STATUS,
String.format(
- "Branch Operation Associate Branch to Artifact {branchUUID: %s prevArt: %s newArt: %s accountId: %s serverId: %s clientId: %s}",
- branchUuid, branch.getAssociatedArtifact(), artifact, RestUtil.getAccountId(httpHeaders),
+ "Branch Operation Associate Branch to Artifact {branchId: %s prevArt: %s newArt: %s accountId: %s serverId: %s clientId: %s}",
+ branchId, branch.getAssociatedArtifact(), artifact, RestUtil.getAccountId(httpHeaders),
RestUtil.getServerId(httpHeaders), RestUtil.getClientId(httpHeaders)));
} catch (OseeCoreException ex) {
OseeLog.log(ActivityLog.class, OseeLevel.SEVERE_POPUP, ex);
@@ -662,15 +658,15 @@ public class BranchEndpointImpl implements BranchEndpoint {
}
@Override
- public Response setTxComment(long branchUuid, int txId, String comment) {
- TransactionReadable tx = getTxByBranchAndId(branchUuid, txId);
+ public Response setTxComment(BranchId branch, int txId, String comment) {
+ TransactionReadable tx = getTxByBranchAndId(branch, txId);
boolean modified = false;
if (Compare.isDifferent(tx.getComment(), comment)) {
try {
activityLog.createEntry(Activity.BRANCH_OPERATION, ActivityLog.INITIAL_STATUS,
String.format(
- "Branch Operation Set Tx Comment {branchUUID: %s prevComment: %s newComment: %s accountId: %s serverId: %s clientId: %s}",
- branchUuid, tx.getComment(), comment, RestUtil.getAccountId(httpHeaders),
+ "Branch Operation Set Tx Comment {branchId: %s prevComment: %s newComment: %s accountId: %s serverId: %s clientId: %s}",
+ branch, tx.getComment(), comment, RestUtil.getAccountId(httpHeaders),
RestUtil.getServerId(httpHeaders), RestUtil.getClientId(httpHeaders)));
} catch (OseeCoreException ex) {
OseeLog.log(ActivityLog.class, OseeLevel.SEVERE_POPUP, ex);
@@ -683,9 +679,9 @@ public class BranchEndpointImpl implements BranchEndpoint {
}
@Override
- public Response purgeBranch(long branchUuid, boolean recurse) {
+ public Response purgeBranch(BranchId branchId, boolean recurse) {
boolean modified = false;
- BranchReadable branch = getBranchById(branchUuid);
+ BranchReadable branch = getBranchById(branchId);
if (branch != null) {
Callable<?> op = getBranchOps().purgeBranch(branch, recurse);
executeCallable(op);
@@ -694,8 +690,8 @@ public class BranchEndpointImpl implements BranchEndpoint {
try {
activityLog.createEntry(Activity.BRANCH_OPERATION, ActivityLog.INITIAL_STATUS,
- String.format("Branch Operation Purge Branch {branchUUID: %s, accountId: %s serverId: %s clientId: %s}",
- branchUuid, RestUtil.getAccountId(httpHeaders), RestUtil.getServerId(httpHeaders),
+ String.format("Branch Operation Purge Branch {branchId: %s, accountId: %s serverId: %s clientId: %s}",
+ branchId, RestUtil.getAccountId(httpHeaders), RestUtil.getServerId(httpHeaders),
RestUtil.getClientId(httpHeaders)));
} catch (OseeCoreException ex) {
OseeLog.log(ActivityLog.class, OseeLevel.SEVERE_POPUP, ex);
@@ -704,8 +700,8 @@ public class BranchEndpointImpl implements BranchEndpoint {
}
@Override
- public Response unarchiveBranch(long branchUuid) {
- BranchReadable branch = getBranchById(branchUuid);
+ public Response unarchiveBranch(BranchId branchId) {
+ BranchReadable branch = getBranchById(branchId);
BranchArchivedState state = branch.getArchiveState();
boolean modified = false;
@@ -715,9 +711,8 @@ public class BranchEndpointImpl implements BranchEndpoint {
modified = true;
try {
activityLog.createEntry(Activity.BRANCH_OPERATION, ActivityLog.INITIAL_STATUS,
- String.format(
- "Branch Operation Unarchive Branch {branchUUID: %s accountId: %s serverId: %s clientId: %s}",
- branchUuid, RestUtil.getAccountId(httpHeaders), RestUtil.getServerId(httpHeaders),
+ String.format("Branch Operation Unarchive Branch {branchId: %s accountId: %s serverId: %s clientId: %s}",
+ branchId, RestUtil.getAccountId(httpHeaders), RestUtil.getServerId(httpHeaders),
RestUtil.getClientId(httpHeaders)));
} catch (OseeCoreException ex) {
OseeLog.log(ActivityLog.class, OseeLevel.SEVERE_POPUP, ex);
@@ -727,13 +722,13 @@ public class BranchEndpointImpl implements BranchEndpoint {
}
@Override
- public Response unCommitBranch(long branchUuid, long destinationBranchUuid) {
+ public Response unCommitBranch(BranchId branch, BranchId destinationBranch) {
throw new UnsupportedOperationException("Not yet implemented");
}
@Override
- public Response unassociateBranch(long branchUuid) {
- BranchReadable branch = getBranchById(branchUuid);
+ public Response unassociateBranch(BranchId branchId) {
+ BranchReadable branch = getBranchById(branchId);
boolean modified = false;
if (branch.getAssociatedArtifact().isValid()) {
Callable<?> op = getBranchOps().unassociateBranch(branch);
@@ -742,8 +737,8 @@ public class BranchEndpointImpl implements BranchEndpoint {
try {
activityLog.createEntry(Activity.BRANCH_OPERATION, ActivityLog.INITIAL_STATUS,
String.format(
- "Branch Operation Unassociate Branch {branchUUID: %s, accountId: %s serverId: %s clientId: %s}",
- branchUuid, RestUtil.getAccountId(httpHeaders), RestUtil.getServerId(httpHeaders),
+ "Branch Operation Unassociate Branch {branchId: %s, accountId: %s serverId: %s clientId: %s}",
+ branchId, RestUtil.getAccountId(httpHeaders), RestUtil.getServerId(httpHeaders),
RestUtil.getClientId(httpHeaders)));
} catch (OseeCoreException ex) {
OseeLog.log(ActivityLog.class, OseeLevel.SEVERE_POPUP, ex);
@@ -753,14 +748,13 @@ public class BranchEndpointImpl implements BranchEndpoint {
}
@Override
- public Response purgeTxs(long branchUuid, String txIds) {
+ public Response purgeTxs(BranchId branch, String txIds) {
boolean modified = false;
List<Long> txsToDelete = OrcsRestUtil.asLongList(txIds);
if (!txsToDelete.isEmpty()) {
- ResultSet<? extends TransactionId> results =
- newTxQuery().andBranchIds(branchUuid).andTxIds(txsToDelete).getResults();
+ ResultSet<? extends TransactionId> results = newTxQuery().andBranch(branch).andTxIds(txsToDelete).getResults();
if (!results.isEmpty()) {
- checkAllTxFoundAreOnBranch("Purge Transaction", branchUuid, txsToDelete, results);
+ checkAllTxFoundAreOnBranch("Purge Transaction", branch, txsToDelete, results);
List<TransactionId> list = Lists.newArrayList(results);
Callable<?> op = newTxFactory().purgeTransaction(list);
executeCallable(op);
@@ -769,8 +763,8 @@ public class BranchEndpointImpl implements BranchEndpoint {
try {
activityLog.createEntry(Activity.BRANCH_OPERATION, ActivityLog.INITIAL_STATUS,
String.format(
- "Branch Operation Purge Txs {branchUUID: %s, txsToDelete: %s accountId: %s serverId: %s clientId: %s}",
- branchUuid, txIds, RestUtil.getAccountId(httpHeaders), RestUtil.getServerId(httpHeaders),
+ "Branch Operation Purge Txs {branchId: %s, txsToDelete: %s accountId: %s serverId: %s clientId: %s}",
+ branch, txIds, RestUtil.getAccountId(httpHeaders), RestUtil.getServerId(httpHeaders),
RestUtil.getClientId(httpHeaders)));
} catch (OseeCoreException ex) {
OseeLog.log(ActivityLog.class, OseeLevel.SEVERE_POPUP, ex);
@@ -780,7 +774,7 @@ public class BranchEndpointImpl implements BranchEndpoint {
return asResponse(modified);
}
- private void checkAllTxFoundAreOnBranch(String opName, long branchUuid, List<Long> txIds, ResultSet<? extends TransactionId> result) {
+ private void checkAllTxFoundAreOnBranch(String opName, BranchId branch, List<Long> txIds, ResultSet<? extends TransactionId> result) {
if (txIds.size() != result.size()) {
Set<Long> found = new HashSet<>();
for (TransactionId tx : result) {
@@ -790,7 +784,7 @@ public class BranchEndpointImpl implements BranchEndpoint {
if (!difference.isEmpty()) {
throw new OseeWebApplicationException(Status.BAD_REQUEST,
"%s Error - The following transactions from %s were not found on branch [%s] - txs %s - Please remove them from the request and try again.",
- opName, txIds, branchUuid, difference);
+ opName, txIds, branch, difference);
}
}
}
diff --git a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/HtmlWriter.java b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/HtmlWriter.java
index fa9409209fc..28a3f76d252 100644
--- a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/HtmlWriter.java
+++ b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/HtmlWriter.java
@@ -79,7 +79,7 @@ public class HtmlWriter {
data.put("Name", artifact.getName());
data.put("Artifact Id", artifact.getUuid());
data.put("Tx Id", artifact.getTransaction());
- Long branchId = artifact.getBranchId();
+ Long branchId = artifact.getBranch().getId();
URI uri;
if (isAtEndOfPath(uriInfo.getPath(), "artifact")) {
diff --git a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/IOrcsValidationHelper.java b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/IOrcsValidationHelper.java
index d20454340d1..8e3d36c7cd2 100644
--- a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/IOrcsValidationHelper.java
+++ b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/IOrcsValidationHelper.java
@@ -10,12 +10,14 @@
*******************************************************************************/
package org.eclipse.osee.orcs.rest.internal.writer;
+import org.eclipse.osee.framework.core.data.BranchId;
+
/**
* @author Donald G. Dunne
*/
public interface IOrcsValidationHelper {
- boolean isBranchExists(long branchUuid);
+ boolean isBranchExists(BranchId branch);
boolean isUserExists(String userId);
@@ -25,7 +27,7 @@ public interface IOrcsValidationHelper {
boolean isAttributeTypeExists(long attributeTypeUuid);
- public boolean isArtifactExists(long branchUuid, long artifactUuid);
+ public boolean isArtifactExists(BranchId branch, long artifactUuid);
boolean isAttributeTypeExists(String attributeTypeName);
diff --git a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsCollectorValidator.java b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsCollectorValidator.java
index 011946354df..5e694a2df4f 100644
--- a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsCollectorValidator.java
+++ b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsCollectorValidator.java
@@ -14,6 +14,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.core.util.XResultData;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -108,7 +109,7 @@ public class OrcsCollectorValidator {
if (!branchValid) {
results.errorf("Invalid Branch; can't validate artifact uuid for [%s].\n", artifact);
} else if (artifactUuid > 0L) {
- if (helper.isArtifactExists(collector.getBranch().getUuid(), artifactUuid)) {
+ if (helper.isArtifactExists(BranchId.valueOf(collector.getBranch().getUuid()), artifactUuid)) {
results.errorf("Artifact with uuid already exists [%s].\n", artifact);
}
if (uuidToArtifact == null) {
@@ -123,7 +124,7 @@ public class OrcsCollectorValidator {
if (!branchValid) {
results.errorf("Invalid Branch; can't validate artifact uuid for [%s].\n", artifact);
} else if (artifactUuid > 0L) {
- if (!helper.isArtifactExists(collector.getBranch().getUuid(), artifactUuid)) {
+ if (!helper.isArtifactExists(BranchId.valueOf(collector.getBranch().getUuid()), artifactUuid)) {
results.errorf("Artifact with uuid does not exist [%s].\n", artifact);
} else {
if (uuidToArtifact == null) {
@@ -156,7 +157,7 @@ public class OrcsCollectorValidator {
// check to see if token is one of the artifacts to create
if (!uuidToArtifact.containsKey(artToken.getUuid())) {
// else, check to see if token exists in db
- if (!helper.isArtifactExists(branchUuid, artToken.getUuid())) {
+ if (!helper.isArtifactExists(BranchId.valueOf(branchUuid), artToken.getUuid())) {
results.errorf(
"Artifact from token [%s] does not exist to relate to artifact [%s] for relation [%s].\n",
artToken, artifact, relation);
@@ -195,7 +196,7 @@ public class OrcsCollectorValidator {
private boolean validateBranch(XResultData results) {
boolean valid = true;
if (collector.getBranch() == null || collector.getBranch().getUuid() <= 0L || !helper.isBranchExists(
- collector.getBranch().getUuid())) {
+ BranchId.valueOf(collector.getBranch().getUuid()))) {
results.errorf("Branch [%s] not valid.\n", collector.getBranch());
valid = false;
}
diff --git a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsValidationHelperAdapter.java b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsValidationHelperAdapter.java
index a9b212fd070..972bba6c3e4 100644
--- a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsValidationHelperAdapter.java
+++ b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsValidationHelperAdapter.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.orcs.rest.internal.writer;
import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.orcs.OrcsApi;
@@ -27,8 +28,8 @@ public class OrcsValidationHelperAdapter implements IOrcsValidationHelper {
}
@Override
- public boolean isBranchExists(long branchUuid) {
- return orcsApi.getQueryFactory().branchQuery().andUuids(branchUuid).getResultsAsId().size() == 1;
+ public boolean isBranchExists(BranchId branch) {
+ return orcsApi.getQueryFactory().branchQuery().andIds(branch).getResultsAsId().size() == 1;
}
@Override
@@ -38,8 +39,8 @@ public class OrcsValidationHelperAdapter implements IOrcsValidationHelper {
}
@Override
- public boolean isArtifactExists(long branchUuid, long artifactUuid) {
- int matchedArtifacts = orcsApi.getQueryFactory().fromBranch(branchUuid).andUuid(artifactUuid).getResults().size();
+ public boolean isArtifactExists(BranchId branch, long artifactUuid) {
+ int matchedArtifacts = orcsApi.getQueryFactory().fromBranch(branch).andUuid(artifactUuid).getResults().size();
return matchedArtifacts == 1;
}
diff --git a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsWriterEndpointImpl.java b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsWriterEndpointImpl.java
index aa85068b9b7..a33e0d9af14 100644
--- a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsWriterEndpointImpl.java
+++ b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsWriterEndpointImpl.java
@@ -44,7 +44,7 @@ public class OrcsWriterEndpointImpl implements OrcsWriterEndpoint {
public Response getOrcsWriterInputDefault() {
OrcsWriterCollectorGenerator generator = new OrcsWriterCollectorGenerator();
OwCollector collector = generator.run(orcsApi);
- StreamingOutput streamingOutput = new OrcsWriterStreamingOutput(orcsApi, 0L, collector);
+ StreamingOutput streamingOutput = new OrcsWriterStreamingOutput(orcsApi, collector);
ResponseBuilder builder = Response.ok(streamingOutput);
builder.header("Content-Disposition", "attachment; filename=" + "OrcsWriterInput.xml");
return builder.build();
@@ -61,7 +61,7 @@ public class OrcsWriterEndpointImpl implements OrcsWriterEndpoint {
public Response getOrcsWriterInputFromConfig(OrcsWriterInputConfig config) {
OrcsWriterCollectorGenerator generator = new OrcsWriterCollectorGenerator(config);
OwCollector collector = generator.run(orcsApi);
- StreamingOutput streamingOutput = new OrcsWriterStreamingOutput(orcsApi, 0L, collector);
+ StreamingOutput streamingOutput = new OrcsWriterStreamingOutput(orcsApi, collector);
ResponseBuilder builder = Response.ok(streamingOutput);
builder.header("Content-Disposition", "attachment; filename=" + "OrcsWriterInput.xml");
return builder.build();
diff --git a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsWriterStreamingOutput.java b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsWriterStreamingOutput.java
index 48a6eed5a66..de5a083f46c 100644
--- a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsWriterStreamingOutput.java
+++ b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsWriterStreamingOutput.java
@@ -22,12 +22,10 @@ import org.eclipse.osee.orcs.rest.model.writer.reader.OwCollector;
*/
public final class OrcsWriterStreamingOutput implements StreamingOutput {
private final OrcsApi orcsApi;
- private final long branchUuid;
private final OwCollector collector;
- public OrcsWriterStreamingOutput(OrcsApi orcsApi, long branchUuid, OwCollector collector) {
+ public OrcsWriterStreamingOutput(OrcsApi orcsApi, OwCollector collector) {
this.orcsApi = orcsApi;
- this.branchUuid = branchUuid;
this.collector = collector;
}
@@ -36,7 +34,7 @@ public final class OrcsWriterStreamingOutput implements StreamingOutput {
try {
Writer writer = new OutputStreamWriter(output);
OrcsWriterWorkbookGenerator generator = new OrcsWriterWorkbookGenerator(collector, orcsApi);
- generator.runOperation(orcsApi, branchUuid, writer);
+ generator.runOperation(orcsApi, writer);
} catch (Exception ex) {
// do nothing
}
diff --git a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsWriterWorkbookGenerator.java b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsWriterWorkbookGenerator.java
index 3a2a26e0197..654b36e8707 100644
--- a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsWriterWorkbookGenerator.java
+++ b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsWriterWorkbookGenerator.java
@@ -51,7 +51,7 @@ public class OrcsWriterWorkbookGenerator {
this.orcsApi = orcsApi;
}
- public void runOperation(OrcsApi providedOrcs, long branchUuid, Writer providedWriter) throws IOException {
+ public void runOperation(OrcsApi providedOrcs, Writer providedWriter) throws IOException {
ISheetWriter writer = new ExcelXmlWriter(providedWriter);
createInstructionSheet(writer);
createCreateSheet(writer);
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsPortingTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsPortingTest.java
index aaf7e4a90ee..d2778b416ce 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsPortingTest.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsPortingTest.java
@@ -72,7 +72,7 @@ public class OrcsPortingTest {
ArtifactId assocaitedArt = setupAssociatedArtifact();
TransactionToken mainBranchTx = createBaselineBranchAndArtifacts();
- IOseeBranch branch = TokenFactory.createBranch(mainBranchTx.getBranchId(), "testCreateBranch");
+ IOseeBranch branch = IOseeBranch.create(mainBranchTx.getBranch(), "testCreateBranch");
TransactionId transactionToCopy = createWorkingBranchChanges(branch, nextReq);
BranchId copyTxBranch = createCopyFromTransactionBranch(transactionToCopy, assocaitedArt);
@@ -83,7 +83,7 @@ public class OrcsPortingTest {
// the attribute for the SecondRequirement should not be named "test changed again" (on the branch after the copy from)
// we should have a folder named "childBranch folder", but no folder named "folder after transaction"
ResultSet<ArtifactReadable> artifacts =
- query.fromBranch(finalTx.getBranchId()).andTypeEquals(CoreArtifactTypes.Artifact).getResults();
+ query.fromBranch(finalTx.getBranch()).andTypeEquals(CoreArtifactTypes.Artifact).getResults();
for (ArtifactReadable art : artifacts) {
if (art.isOfType(CoreArtifactTypes.SoftwareRequirement)) {
assertEquals(2, art.getAttributes().size());
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 a6efebfa912..19c19973ebd 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
@@ -346,7 +346,7 @@ public class OrcsTransactionTest {
tx.relate(artifact2, Default_Hierarchical__Parent, artifact1);
TransactionId tx1 = tx.commit();
- tx = txFactory.createTransaction(COMMON, userArtifact, "delete art 1 attribute");
+ tx = txFactory.createTransaction(COMMON, userArtifact, "create art 1 attribute");
tx.deleteAttributes(artifact1, CoreAttributeTypes.GeneralStringData);
TransactionId tx2 = tx.commit();
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTxQueryTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTxQueryTest.java
index 76791f5ce2a..9d787f147c9 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTxQueryTest.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTxQueryTest.java
@@ -32,6 +32,7 @@ import java.util.List;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.TransactionId;
+import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -394,7 +395,7 @@ public class OrcsTxQueryTest {
@Test
public void testGetHead() throws Exception {
TransactionQuery query = factory.transactionQuery();
- query.andIsHead(1);
+ query.andIsHead(CoreBranches.SYSTEM_ROOT);
ResultSet<TransactionReadable> results = query.getResults();
assertEquals(1, query.getCount());
@@ -479,7 +480,7 @@ public class OrcsTxQueryTest {
assertEquals(comment, transaction.getComment());
assertEquals(author, transaction.getAuthor());
- assertEquals(branch, transaction.getBranchId());
+ assertEquals(branch, transaction.getBranch());
assertTrue(transaction.getCommitArt().isInvalid());
}
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/CreateBranchData.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/CreateBranchData.java
index 9fc7901b638..98d878db43e 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/CreateBranchData.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/CreateBranchData.java
@@ -13,21 +13,18 @@ package org.eclipse.osee.orcs.data;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.TransactionId;
+import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.enums.BranchType;
-import org.eclipse.osee.framework.jdk.core.type.Identifiable;
-import org.eclipse.osee.framework.jdk.core.type.Identity;
-import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
/**
* @author Roberto E. Escobar
*/
-public class CreateBranchData implements Identifiable<Long> {
+public class CreateBranchData {
private final long MERGE_DESTINATION_BRANCH_ID = -1; // only used on merge branches
private final int MERGE_ADDRESSING_QUERY_ID = -1; // only used on merge branches
private String branchName;
- private long branchUuid;
+ private final BranchId branch;
private BranchType branchType;
private String creationComment;
private TransactionId fromTransaction;
@@ -43,23 +40,17 @@ public class CreateBranchData implements Identifiable<Long> {
private BranchId parentBranch;
public CreateBranchData() {
- this(Lib.generateUuid());
+ this(TokenFactory.createBranch());
}
- public CreateBranchData(long uuid) {
- branchUuid = uuid;
- }
-
- @Override
- public Long getGuid() {
- return branchUuid;
+ public CreateBranchData(BranchId branch) {
+ this.branch = branch;
}
public ArtifactId getAssociatedArtifact() {
return associatedArtifact;
}
- @Override
public String getName() {
return branchName;
}
@@ -130,15 +121,12 @@ public class CreateBranchData implements Identifiable<Long> {
@Override
public int hashCode() {
- return getGuid().hashCode();
+ return branch.hashCode();
}
@Override
public boolean equals(Object obj) {
- if (obj instanceof Identity) {
- return getGuid().equals(((Identity<?>) obj).getGuid());
- }
- return false;
+ return branch.equals(obj);
}
public boolean isTxCopyBranchType() {
@@ -151,18 +139,11 @@ public class CreateBranchData implements Identifiable<Long> {
@Override
public String toString() {
- return "CreateBranchData [branchUuid=" + branchUuid + ", branchName=" + branchName + ", branchType=" + branchType + ", creationComment=" + creationComment + ", fromTransaction=" + fromTransaction + ", associatedArtifact=" + associatedArtifact + ", userArtifact=" + author + ", mergeAddressingQueryId=" + mergeAddressingQueryId + ", destinationBranchId=" + mergeDestinationBranchId + "]";
- }
-
- public long getUuid() {
- return branchUuid;
+ return "CreateBranchData [branchUuid=" + branch + ", branchName=" + branchName + ", branchType=" + branchType + ", creationComment=" + creationComment + ", fromTransaction=" + fromTransaction + ", associatedArtifact=" + associatedArtifact + ", author=" + author + ", mergeAddressingQueryId=" + mergeAddressingQueryId + ", destinationBranchId=" + mergeDestinationBranchId + "]";
}
- public void setUuid(long uuid) {
- if (uuid <= 0) {
- throw new OseeStateException("uuid [%d] must be > 0", uuid);
- }
- this.branchUuid = uuid;
+ public BranchId getBranch() {
+ return branch;
}
public void setParentBranch(BranchId parentBranch) {
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 ac270e510fc..db67c51b036 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
@@ -58,7 +58,7 @@ public interface BranchQueryBuilder<T> {
T andIsAncestorOf(BranchId branch) throws OseeCoreException;
- T andIsMergeFor(Long sourceUuid, Long destUuid);
+ T andIsMergeFor(BranchId source, BranchId destination);
T andAssociatedArtId(int artId);
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/TxQueryBuilder.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/TxQueryBuilder.java
index 1e1fd6a2761..6f277d027cd 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/TxQueryBuilder.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/TxQueryBuilder.java
@@ -68,8 +68,6 @@ public interface TxQueryBuilder<T> {
T andNullCommitId() throws OseeCoreException;
- T andIsHead(long branchUuid) throws OseeCoreException;
-
T andIsHead(BranchId branch) throws OseeCoreException;
T andIsPriorTx(TransactionId txId) throws OseeCoreException;
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/transaction/TransactionBuilder.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/transaction/TransactionBuilder.java
index f8fd9a89ce3..a86b4a7b3a4 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/transaction/TransactionBuilder.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/transaction/TransactionBuilder.java
@@ -35,7 +35,7 @@ import org.eclipse.osee.orcs.data.TransactionReadable;
*/
public interface TransactionBuilder {
- Long getBranchId();
+ BranchId getBranch();
String getComment();

Back to the top