Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2014-03-28 15:48:55 +0000
committerdonald.g.dunne2014-04-09 15:32:55 +0000
commit1f8e94e66234595711ccb229869d8ca2b4ed9489 (patch)
tree6febe577cd4f1d9a548d942e626695fd7214f6bf /plugins/org.eclipse.osee.orcs.core
parent568a307e7e6655ada9a1638e2cb76cb9f79699b7 (diff)
downloadorg.eclipse.osee-1f8e94e66234595711ccb229869d8ca2b4ed9489.tar.gz
org.eclipse.osee-1f8e94e66234595711ccb229869d8ca2b4ed9489.tar.xz
org.eclipse.osee-1f8e94e66234595711ccb229869d8ca2b4ed9489.zip
feature[ats_ATS19845]: Convert IOseeBranch to Identity-Long
Diffstat (limited to 'plugins/org.eclipse.osee.orcs.core')
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/BranchData.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranchUuids.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaTxBranchUuids.java46
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaTxGetHead.java34
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/branch/BranchDataFactory.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/console/BranchPurgeCommand.java24
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/console/IndexerCommand.java8
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchCallableQueryFactory.java8
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchCriteriaFactory.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchQueryImpl.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/TransactionCriteriaFactory.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/TransactionQueryImpl.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/OrcsTypesIndexer.java18
13 files changed, 58 insertions, 126 deletions
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/BranchData.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/BranchData.java
index d3b4f556a5f..1597996f823 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/BranchData.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/BranchData.java
@@ -20,11 +20,9 @@ import org.eclipse.osee.orcs.data.HasLocalId;
*/
public interface BranchData extends HasLocalId<Long> {
- void setLocalId(Long id);
+ void setUuid(Long id);
- String getGuid();
-
- void setGuid(String guid);
+ long getUuid();
String getName();
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranchUuids.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranchUuids.java
index 3d60c5de38b..a3a1cf56457 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranchUuids.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranchUuids.java
@@ -21,14 +21,14 @@ import org.eclipse.osee.orcs.core.ds.Options;
*/
public class CriteriaBranchUuids extends Criteria {
- private final Collection<String> ids;
+ private final Collection<Long> ids;
- public CriteriaBranchUuids(Collection<String> ids) {
+ public CriteriaBranchUuids(Collection<Long> ids) {
super();
this.ids = ids;
}
- public Collection<String> getIds() {
+ public Collection<Long> getIds() {
return ids;
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaTxBranchUuids.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaTxBranchUuids.java
deleted file mode 100644
index 5bf160a1221..00000000000
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaTxBranchUuids.java
+++ /dev/null
@@ -1,46 +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.ds.criteria;
-
-import java.util.Collection;
-import org.eclipse.osee.framework.core.data.IOseeBranch;
-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;
-import org.eclipse.osee.orcs.core.ds.Options;
-
-/**
- * @author Roberto E. Escobar
- */
-public class CriteriaTxBranchUuids extends Criteria {
-
- private final Collection<? extends IOseeBranch> ids;
-
- public CriteriaTxBranchUuids(Collection<? extends IOseeBranch> ids) {
- super();
- this.ids = ids;
- }
-
- public Collection<? extends IOseeBranch> getIds() {
- return ids;
- }
-
- @Override
- public void checkValid(Options options) throws OseeCoreException {
- Conditions.checkExpressionFailOnTrue(getIds().isEmpty(), "Branch Ids cannot be empty");
- }
-
- @Override
- public String toString() {
- return "CriteriaTxBranchUuids [ids=" + ids + "]";
- }
-
-}
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 ee1143496a6..ffa2ecf4e60 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,51 +10,27 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.ds.criteria;
-import org.eclipse.osee.framework.core.data.IOseeBranch;
-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;
-import org.eclipse.osee.orcs.core.ds.Options;
/**
* @author Roberto E. Escobar
*/
public class CriteriaTxGetHead extends Criteria {
- private final IOseeBranch branch;
- private final int branchId;
+ private final long branchId;
- public CriteriaTxGetHead(IOseeBranch branch) {
- super();
- this.branch = branch;
- this.branchId = -1;
- }
-
- public CriteriaTxGetHead(int branchId) {
+ public CriteriaTxGetHead(long branchId) {
super();
this.branchId = branchId;
- this.branch = null;
- }
-
- @Override
- public void checkValid(Options options) throws OseeCoreException {
- Conditions.checkExpressionFailOnTrue(branch == null && branchId < 0, "Missing valid branch");
}
- public boolean hasBranchToken() {
- return branch != null;
- }
-
- public IOseeBranch getBranch() {
- return branch;
- }
-
- public int getBranchid() {
+ public long getBranchid() {
return branchId;
}
@Override
public String toString() {
- return "CriteriaGetHead";
+ return "CriteriaTxGetHead [branchId=" + branchId + "]";
}
+
}
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 f1d80eb87dd..aa7585b0e94 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
@@ -82,7 +82,7 @@ public class BranchDataFactory {
private CreateBranchData createBranchData(IOseeBranch branch, BranchType branchType, String creationComment, ITransaction fromTx, ArtifactReadable author, ArtifactReadable associatedArtifact, boolean bCopyTx) {
CreateBranchData createData = new CreateBranchData();
- createData.setGuid(branch.getGuid());
+ createData.setUuid(branch.getGuid());
createData.setName(branch.getName());
if (branch.getUuid() > 0) {
createData.setUuid(branch.getUuid());
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/console/BranchPurgeCommand.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/console/BranchPurgeCommand.java
index 8269daf15d1..ab45bd4d16a 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/console/BranchPurgeCommand.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/console/BranchPurgeCommand.java
@@ -29,7 +29,6 @@ import org.eclipse.osee.framework.core.enums.BranchState;
import org.eclipse.osee.framework.core.enums.BranchType;
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.GUID;
import org.eclipse.osee.orcs.OrcsApi;
import org.eclipse.osee.orcs.OrcsBranch;
import org.eclipse.osee.orcs.core.internal.branch.BranchUtil;
@@ -68,7 +67,7 @@ public final class BranchPurgeCommand implements ConsoleCommand {
public String getUsage() {
// includeChildren excludes baseline branches
StringBuilder sb = new StringBuilder();
- sb.append("Usage: branch_purge [-R] [-D] [-A] [-B] [-P] branchGuids=<BRANCH_GUID,..>\n");
+ sb.append("Usage: branch_purge [-R] [-D] [-A] [-B] [-P] branchUuids=<BRANCH_UUID,..>\n");
sb.append("Synopsis:\n");
sb.append("\tCAUTION: This command will permanently remove branches from the datastore!\n");
sb.append("\tThis command has no effect unless the [P] option is specified, otherwise it\n");
@@ -87,9 +86,10 @@ public final class BranchPurgeCommand implements ConsoleCommand {
@Override
public Callable<?> createCallable(Console console, ConsoleParameters params) {
- List<String> branchGuids = Arrays.asList(params.getArray("branchGuids"));
+ List<Long> branchUuids = new ArrayList<Long>();
+ Arrays.asList(params.getArray("branchUuids"));
- if (branchGuids.isEmpty()) {
+ if (branchUuids.isEmpty()) {
console.writeln("No branch guids where specified");
}
@@ -101,7 +101,7 @@ public final class BranchPurgeCommand implements ConsoleCommand {
boolean runPurge = options.contains("P");
OrcsBranch orcsBranch = getOrcsApi().getBranchOps(null);
- return new PurgeBranchCallable(console, orcsBranch, getOrcsApi().getQueryFactory(null), branchGuids, recurse,
+ return new PurgeBranchCallable(console, orcsBranch, getOrcsApi().getQueryFactory(null), branchUuids, recurse,
unArchived, unDeleted, baseline, runPurge);
}
@@ -109,7 +109,7 @@ public final class BranchPurgeCommand implements ConsoleCommand {
private final Console console;
private final OrcsBranch orcsBranch;
- private final List<String> branchGuids;
+ private final List<Long> branchUuids;
private final boolean recurse;
private final boolean includeUnarchived;
private final boolean includeUndeleted;
@@ -117,11 +117,11 @@ public final class BranchPurgeCommand implements ConsoleCommand {
private final boolean runPurge;
private final QueryFactory queryFactory;
- public PurgeBranchCallable(Console console, OrcsBranch orcsBranch, QueryFactory queryFactory, List<String> branchGuids, boolean recurse, boolean unArchived, boolean unDeleted, boolean baseline, boolean runPurge) {
+ public PurgeBranchCallable(Console console, OrcsBranch orcsBranch, QueryFactory queryFactory, List<Long> branchUuids, boolean recurse, boolean unArchived, boolean unDeleted, boolean baseline, boolean runPurge) {
this.console = console;
this.orcsBranch = orcsBranch;
this.queryFactory = queryFactory;
- this.branchGuids = branchGuids;
+ this.branchUuids = branchUuids;
this.recurse = recurse;
this.includeUnarchived = unArchived;
this.includeUndeleted = unDeleted;
@@ -145,11 +145,11 @@ public final class BranchPurgeCommand implements ConsoleCommand {
private Collection<BranchReadable> getBranchesToPurge() throws OseeCoreException {
Set<BranchReadable> specifiedBranches = new HashSet<BranchReadable>();
- for (String guid : branchGuids) {
- if (!GUID.isValid(guid)) {
- console.write("GUID listed %s is not a valid GUID", guid);
+ for (Long uuid : branchUuids) {
+ if (uuid > 0) {
+ console.write("UUID listed %s is not a valid UUID", uuid);
} else {
- BranchReadable cached = queryFactory.branchQuery().andUuids(guid).getResults().getExactlyOne();
+ BranchReadable cached = queryFactory.branchQuery().andUuids(uuid).getResults().getExactlyOne();
if (cached != null) {
specifiedBranches.add(cached);
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/console/IndexerCommand.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/console/IndexerCommand.java
index 258f44ceafa..7f87222bf6b 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/console/IndexerCommand.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/console/IndexerCommand.java
@@ -109,10 +109,10 @@ public class IndexerCommand implements ConsoleCommand {
boolean indexOnlyMissingitems = false;
Set<BranchReadable> branches = new HashSet<BranchReadable>();
- String[] guids = params.getArray("branchGuids");
- if (guids != null & guids.length > 0) {
- for (String guid : guids) {
- branches.add(getOrcsApi().getQueryFactory(null).branchQuery().andUuids(guid).getResults().getExactlyOne());
+ String[] uuids = params.getArray("branchUuids");
+ if (uuids != null & uuids.length > 0) {
+ for (String uuid : uuids) {
+ branches.add(getOrcsApi().getQueryFactory(null).branchQuery().andUuids(Long.valueOf(uuid)).getResults().getExactlyOne());
}
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchCallableQueryFactory.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchCallableQueryFactory.java
index 46b3b97918b..9ec6507b734 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchCallableQueryFactory.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchCallableQueryFactory.java
@@ -90,7 +90,7 @@ public class BranchCallableQueryFactory {
@Override
public IOseeBranch createBranch(BranchData data) {
- return TokenFactory.createBranch(data.getGuid(), data.getName());
+ return TokenFactory.createBranch(data.getUuid(), data.getName());
}
};
@@ -105,13 +105,13 @@ public class BranchCallableQueryFactory {
private abstract class BranchBuilder<T extends IOseeBranch> extends LoadDataHandlerAdapter {
- private Map<String, T> branchMap;
+ private Map<Long, T> branchMap;
private List<T> results;
@Override
public void onLoadStart() throws OseeCoreException {
super.onLoadStart();
- branchMap = new LinkedHashMap<String, T>();
+ branchMap = new LinkedHashMap<Long, T>();
}
@Override
@@ -123,7 +123,7 @@ public class BranchCallableQueryFactory {
@Override
public void onData(BranchData data) throws OseeCoreException {
- String key = data.getGuid();
+ Long key = data.getUuid();
T branch = branchMap.get(key);
if (branch == null) {
branch = createBranch(data);
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 4e61f2fd725..bd2b86d068a 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
@@ -29,7 +29,7 @@ public class BranchCriteriaFactory {
return new CriteriaBranchIds(ids);
}
- public Criteria createBranchUuidsCriteria(Collection<String> ids) {
+ public Criteria createBranchUuidsCriteria(Collection<Long> ids) {
return new CriteriaBranchUuids(ids);
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchQueryImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchQueryImpl.java
index 77dafe24042..b62c7f6303f 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchQueryImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchQueryImpl.java
@@ -125,12 +125,12 @@ public class BranchQueryImpl implements BranchQuery {
}
@Override
- public BranchQuery andUuids(String... ids) throws OseeCoreException {
+ public BranchQuery andUuids(Long... ids) throws OseeCoreException {
return andUuids(Arrays.asList(ids));
}
@Override
- public BranchQuery andUuids(Collection<String> ids) throws OseeCoreException {
+ public BranchQuery andUuids(Collection<Long> ids) throws OseeCoreException {
Criteria criteria = criteriaFactory.createBranchUuidsCriteria(ids);
return addAndCheck(getQueryData(), criteria);
}
@@ -142,7 +142,7 @@ public class BranchQueryImpl implements BranchQuery {
@Override
public BranchQuery andIds(Collection<? extends IOseeBranch> ids) throws OseeCoreException {
- Set<String> allIds = new HashSet<String>();
+ Set<Long> allIds = new HashSet<Long>();
for (IOseeBranch token : ids) {
allIds.add(token.getGuid());
}
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 895537dbbcd..1064134bc3f 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,7 +13,6 @@ package org.eclipse.osee.orcs.core.internal.search;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Collection;
-import org.eclipse.osee.framework.core.data.IOseeBranch;
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;
@@ -23,7 +22,6 @@ import org.eclipse.osee.orcs.core.ds.criteria.CriteriaDateRange;
import org.eclipse.osee.orcs.core.ds.criteria.CriteriaDateWithOperator;
import org.eclipse.osee.orcs.core.ds.criteria.CriteriaTxArtifactGuids;
import org.eclipse.osee.orcs.core.ds.criteria.CriteriaTxBranchIds;
-import org.eclipse.osee.orcs.core.ds.criteria.CriteriaTxBranchUuids;
import org.eclipse.osee.orcs.core.ds.criteria.CriteriaTxComment;
import org.eclipse.osee.orcs.core.ds.criteria.CriteriaTxGetHead;
import org.eclipse.osee.orcs.core.ds.criteria.CriteriaTxIdWithOperator;
@@ -58,10 +56,6 @@ public class TransactionCriteriaFactory {
return new CriteriaTxBranchIds(ids);
}
- public Criteria newTxBranchUuidCriteria(Collection<? extends IOseeBranch> ids) {
- return new CriteriaTxBranchUuids(ids);
- }
-
public Criteria newByIdWithOperator(Operator op, int id) {
return new CriteriaTxIdWithOperator(op, id);
}
@@ -94,12 +88,8 @@ public class TransactionCriteriaFactory {
return new CriteriaCommitIds(ids);
}
- public Criteria newGetHead(int branchId) {
+ public Criteria newGetHead(long branchId) {
return new CriteriaTxGetHead(branchId);
}
- public Criteria newGetHead(IOseeBranch branch) {
- return new CriteriaTxGetHead(branch);
- }
-
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/TransactionQueryImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/TransactionQueryImpl.java
index cbc330a2595..79798396df5 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/TransactionQueryImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/TransactionQueryImpl.java
@@ -120,7 +120,11 @@ public class TransactionQueryImpl implements TransactionQuery {
@Override
public TransactionQuery andBranch(Collection<? extends IOseeBranch> ids) throws OseeCoreException {
- Criteria criteria = criteriaFactory.newTxBranchUuidCriteria(ids);
+ Set<Long> values = new LinkedHashSet<Long>();
+ for (IOseeBranch value : ids) {
+ values.add(value.getUuid());
+ }
+ Criteria criteria = criteriaFactory.newTxBranchIdCriteria(values);
addAndCheck(queryData, criteria);
return this;
}
@@ -252,13 +256,11 @@ public class TransactionQueryImpl implements TransactionQuery {
@Override
public TransactionQuery andIsHead(IOseeBranch branch) throws OseeCoreException {
- Criteria criteria = criteriaFactory.newGetHead(branch);
- addAndCheck(queryData, criteria);
- return this;
+ return andIsHead(branch.getUuid());
}
@Override
- public TransactionQuery andIsHead(int branchId) throws OseeCoreException {
+ public TransactionQuery andIsHead(long branchId) throws OseeCoreException {
Criteria criteria = criteriaFactory.newGetHead(branchId);
addAndCheck(queryData, criteria);
return this;
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/OrcsTypesIndexer.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/OrcsTypesIndexer.java
index d8d0971de27..34c7a126c01 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/OrcsTypesIndexer.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/OrcsTypesIndexer.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.internal.types.impl;
+import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.Collection;
import java.util.Collections;
@@ -82,6 +83,7 @@ public class OrcsTypesIndexer {
InputStream inputStream = null;
try {
inputStream = source.getContent();
+ inputStream = upConvertTo17(inputStream);
resource = OseeDslResourceUtil.loadModel(source.getLocation().toASCIIString(), inputStream);
} finally {
Lib.close(inputStream);
@@ -130,6 +132,14 @@ public class OrcsTypesIndexer {
return index;
}
+ private InputStream upConvertTo17(InputStream inputStream) throws Exception {
+ String typesStr = Lib.inputStreamToString(inputStream);
+ typesStr = typesStr.replaceAll("branchGuid \"AyH_fAj8lhQGmQw2iBAA\"", "branchUuid 423");
+ typesStr = typesStr.replaceAll("branchGuid \"AyH_e5wAblOqTdLkxqQA\"", "branchUuid 714");
+ typesStr = typesStr.replaceAll("branchGuid \"GyoL_rFqqBYbOcuGYzQA\"", "branchUuid 4312");
+ return new ByteArrayInputStream(typesStr.getBytes("UTF-8"));
+ }
+
private void indexSuperTypes(ArtifactTypeIndex artifactTypeIndex, IArtifactType token, XArtifactType dslType) throws OseeCoreException {
Set<IArtifactType> tokenSuperTypes = Sets.newLinkedHashSet();
for (XArtifactType superTypes : dslType.getSuperArtifactTypes()) {
@@ -228,9 +238,11 @@ public class OrcsTypesIndexer {
private IOseeBranch getAttributeBranch(XAttributeTypeRef xAttributeTypeRef) {
IOseeBranch branchToken = CoreBranches.SYSTEM_ROOT;
- String branchGuid = xAttributeTypeRef.getBranchGuid();
- if (branchGuid != null) {
- branchToken = TokenFactory.createBranch(branchGuid, branchGuid);
+ if (Strings.isValid(xAttributeTypeRef.getBranchUuid())) {
+ long branchUuid = Long.valueOf(xAttributeTypeRef.getBranchUuid());
+ if (branchUuid > 0) {
+ branchToken = TokenFactory.createBranch(branchUuid, String.valueOf(branchUuid));
+ }
}
return branchToken;
}

Back to the top