Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java9
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java7
2 files changed, 10 insertions, 6 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java
index d749b82b5ac..13fc94a9d09 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java
@@ -376,15 +376,12 @@ public class ArtifactQuery {
}
public static List<Artifact> getArtifactListFromTypeWithInheritence(ArtifactTypeToken artifactType, BranchId branch, DeletionFlag allowDeleted) {
- Collection<ArtifactTypeToken> artifactTypes = artifactType.getAllDescendantTypes();
- artifactTypes.add(artifactType);
- return getArtifactListFromTypes(artifactTypes, branch, allowDeleted);
+ return new ArtifactQueryBuilder(artifactType, branch, ALL, allowDeleted).getArtifacts(1000, null);
}
public static int getArtifactCountFromTypeWithInheritence(ArtifactTypeToken artifactType, BranchId branch, DeletionFlag allowDeleted) {
- Collection<ArtifactTypeToken> artifactTypes = artifactType.getAllDescendantTypes();
- artifactTypes.add(artifactType);
- return getArtifactCountFromTypes(artifactTypes, branch, allowDeleted);
+ ArtifactQueryBuilder builder = new ArtifactQueryBuilder(artifactType, branch, ALL, allowDeleted);
+ return builder.countArtifacts();
}
public static int getArtifactCountFromTypes(Collection<? extends ArtifactTypeId> artifactTypes, BranchId branch, DeletionFlag allowDeleted) {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java
index 0c76edf9dc8..1e08ac8bc77 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java
@@ -29,6 +29,7 @@ import java.util.LinkedList;
import java.util.List;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.ArtifactTypeId;
+import org.eclipse.osee.framework.core.data.ArtifactTypeToken;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.data.TransactionToken;
@@ -61,6 +62,7 @@ public class ArtifactQueryBuilder {
private ArtifactId artifactId;
private Collection<? extends ArtifactId> artifactIds;
private final Collection<? extends ArtifactTypeId> artifactTypes;
+ private ArtifactTypeToken artifactTypeWithInheritence;
private final DeletionFlag allowDeleted;
private final LoadLevel loadLevel;
private boolean emptyCriteria = false;
@@ -127,6 +129,11 @@ public class ArtifactQueryBuilder {
emptyCriteria = artifactTypes.isEmpty();
}
+ public ArtifactQueryBuilder(ArtifactTypeToken artifactTypeWithInheritence, BranchId branch, LoadLevel loadLevel, DeletionFlag allowDeleted) {
+ this(null, ArtifactId.SENTINEL, null, null, null, branch, TransactionToken.SENTINEL, allowDeleted, loadLevel);
+ this.artifactTypeWithInheritence = artifactTypeWithInheritence;
+ }
+
public ArtifactQueryBuilder(BranchId branch, LoadLevel loadLevel, DeletionFlag allowDeleted) {
this(null, ArtifactId.SENTINEL, null, null, null, branch, TransactionToken.SENTINEL, allowDeleted, loadLevel);
}

Back to the top