Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2017-11-21 22:43:18 +0000
committerRyan D. Brooks2020-12-15 21:45:14 +0000
commit9f81f171bd2e8c493d46e063d980a0f1905b6558 (patch)
tree7e7e24a3d64b4e58d5f017cfdc77513eac58b58e
parentb837ada10a7e251af52e6bee3051ef185f3778b5 (diff)
downloadorg.eclipse.osee-9f81f171bd2e8c493d46e063d980a0f1905b6558.tar.gz
org.eclipse.osee-9f81f171bd2e8c493d46e063d980a0f1905b6558.tar.xz
org.eclipse.osee-9f81f171bd2e8c493d46e063d980a0f1905b6558.zip
feature: Add selective artifact loading
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ValueKind.java32
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/RelationSide.java5
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/Query.java3
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/QueryBuilder.java24
4 files changed, 62 insertions, 2 deletions
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ValueKind.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ValueKind.java
new file mode 100644
index 00000000000..fe5f73fe70e
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ValueKind.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2017 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.framework.core.data;
+
+import org.eclipse.osee.framework.jdk.core.type.BaseId;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public final class ValueKind extends BaseId {
+ public static final ValueKind Value = new ValueKind(1L);
+ public static final ValueKind Id = new ValueKind(2L);
+ public static final ValueKind Rationale = new ValueKind(3L);
+ public static final ValueKind GammaId = new ValueKind(4L);
+ public static final ValueKind TxId = new ValueKind(5L);
+ /**
+ * when combined with a single attribute type (typically CoreAttributeTypes.Name) this will result in ArtifactTokens
+ */
+ public static final ValueKind[] ValueAndId = new ValueKind[] {Value, Id};
+
+ private ValueKind(Long id) {
+ super(id);
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/RelationSide.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/RelationSide.java
index 38db90571fb..cf933360d13 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/RelationSide.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/RelationSide.java
@@ -22,7 +22,8 @@ import org.eclipse.osee.framework.jdk.core.util.Strings;
*/
public enum RelationSide {
SIDE_A,
- SIDE_B;
+ SIDE_B,
+ BOTH;
public RelationSide oppositeSide() {
return this == SIDE_A ? SIDE_B : SIDE_A;
@@ -52,4 +53,4 @@ public enum RelationSide {
public static RelationSide valueOf(boolean sideA) {
return sideA ? SIDE_A : SIDE_B;
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/Query.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/Query.java
index 730b3f84949..4f01e894f8e 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/Query.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/Query.java
@@ -19,6 +19,9 @@ package org.eclipse.osee.orcs.search;
*/
public interface Query {
+ /**
+ * Count search results
+ */
int getCount();
boolean exists();
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/QueryBuilder.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/QueryBuilder.java
index e67a3b10bf6..8267e07650a 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/QueryBuilder.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/QueryBuilder.java
@@ -28,6 +28,9 @@ import org.eclipse.osee.framework.core.data.RelationTypeSide;
import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.enums.QueryOption;
+import org.eclipse.osee.framework.core.data.RelationTypeId;
+import org.eclipse.osee.framework.core.data.ValueKind;
+import org.eclipse.osee.framework.core.enums.RelationSide;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.orcs.data.ArtifactReadable;
import org.eclipse.osee.orcs.data.AttributeReadable;
@@ -62,6 +65,27 @@ public interface QueryBuilder extends Query {
List<Map<String, Object>> asArtifactMaps();
+ List<Map<String, Object>> load();
+
+ /**
+ * same as select(attributeType, ValueKind.Value)
+ */
+ QueryBuilder select(AttributeTypeId attributeType);
+
+ QueryBuilder select(AttributeTypeId attributeType, ValueKind valueKind);
+
+ QueryBuilder select(AttributeTypeId attributeType, ValueKind[] valueKinds);
+
+ /**
+ * Follows the relation and does not collect any data (no valueKind), so it is only useful if followed by a select
+ * call
+ */
+ QueryBuilder follow(RelationTypeId relationType, RelationSide side);
+
+ QueryBuilder follow(RelationTypeId relationType, RelationSide side, ValueKind valueKind);
+
+ QueryBuilder follow(RelationTypeId relationType, RelationSide side, ValueKind[] valueKinds);
+
/**
* @return a single ArtifactId if exactly one found. Return ArtifactId.SENTINEL is none found, else throw exception
* for finding more than one

Back to the top