diff options
author | rbrooks | 2010-10-06 00:09:10 +0000 |
---|---|---|
committer | Ryan D. Brooks | 2010-10-06 00:09:10 +0000 |
commit | 4a486fbee7d08086529b2da99c2a4fa10ae9a1ec (patch) | |
tree | d80f84dc82b3d0647c8251605b877bcd2cba55eb /plugins | |
parent | f846c252c91c81084b73711c0a934769373d4afe (diff) | |
download | org.eclipse.osee-4a486fbee7d08086529b2da99c2a4fa10ae9a1ec.tar.gz org.eclipse.osee-4a486fbee7d08086529b2da99c2a4fa10ae9a1ec.tar.xz org.eclipse.osee-4a486fbee7d08086529b2da99c2a4fa10ae9a1ec.zip |
refactor: Make RelationCriteria use type tokens
Diffstat (limited to 'plugins')
2 files changed, 10 insertions, 10 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 639f27e5bb9..d8b9b67738f 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 @@ -23,6 +23,7 @@ import java.util.Set; import org.eclipse.osee.framework.core.data.IArtifactType; import org.eclipse.osee.framework.core.data.IAttributeType; import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.IRelationType; import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; import org.eclipse.osee.framework.core.enums.DeletionFlag; import org.eclipse.osee.framework.core.enums.RelationSide; @@ -35,7 +36,6 @@ import org.eclipse.osee.framework.core.message.SearchRequest; import org.eclipse.osee.framework.core.model.TransactionRecord; import org.eclipse.osee.framework.core.model.event.IBasicGuidArtifact; import org.eclipse.osee.framework.core.model.type.ArtifactType; -import org.eclipse.osee.framework.core.model.type.RelationType; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.artifact.ArtifactCache; import org.eclipse.osee.framework.skynet.core.artifact.ArtifactLoader; @@ -351,7 +351,7 @@ public class ArtifactQuery { * * @return a collection of the artifacts found or an empty collection if none are found */ - public static List<Artifact> getRelatedArtifactList(Artifact artifact, RelationType relationType, RelationSide relationSide) throws OseeCoreException { + public static List<Artifact> getRelatedArtifactList(Artifact artifact, IRelationType relationType, RelationSide relationSide) throws OseeCoreException { return new ArtifactQueryBuilder(artifact.getBranch(), FULL, EXCLUDE_DELETED, new RelationCriteria( artifact.getArtId(), relationType, relationSide)).getArtifacts(1000, null); } @@ -361,7 +361,7 @@ public class ArtifactQuery { * * @return a collection of the artifacts found or an empty collection if none are found */ - public static List<Artifact> getArtifactListFromRelation(RelationType relationType, RelationSide relationSide, IOseeBranch branch) throws OseeCoreException { + public static List<Artifact> getArtifactListFromRelation(IRelationType relationType, RelationSide relationSide, IOseeBranch branch) throws OseeCoreException { return new ArtifactQueryBuilder(branch, FULL, EXCLUDE_DELETED, new RelationCriteria(relationType, relationSide)).getArtifacts( 1000, null); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/RelationCriteria.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/RelationCriteria.java index 2a9954f3e44..5e96f6d6393 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/RelationCriteria.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/RelationCriteria.java @@ -10,17 +10,17 @@ *******************************************************************************/ package org.eclipse.osee.framework.skynet.core.artifact.search; +import org.eclipse.osee.framework.core.data.IRelationType; import org.eclipse.osee.framework.core.enums.IRelationEnumeration; import org.eclipse.osee.framework.core.enums.RelationSide; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.type.RelationType; import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager; /** * @author Ryan D. Brooks */ public class RelationCriteria extends AbstractArtifactSearchCriteria { - private final RelationType relationType; + private final IRelationType relationType; private final RelationSide relationSide; private String txsAlias; private String relAlias; @@ -31,15 +31,15 @@ public class RelationCriteria extends AbstractArtifactSearchCriteria { * * @param relationEnum the side to start following the link from */ - public RelationCriteria(IRelationEnumeration relationEnum) throws OseeCoreException { - this(RelationTypeManager.getType(relationEnum), relationEnum.getSide()); + public RelationCriteria(IRelationEnumeration relationEnum) { + this(relationEnum, relationEnum.getSide()); } - public RelationCriteria(RelationType relationType, RelationSide relationSide) { + public RelationCriteria(IRelationType relationType, RelationSide relationSide) { this(0, relationType, relationSide); } - public RelationCriteria(int artifactId, RelationType relationType, RelationSide relationSide) { + public RelationCriteria(int artifactId, IRelationType relationType, RelationSide relationSide) { this.artifactId = artifactId; this.relationType = relationType; this.relationSide = relationSide; @@ -62,7 +62,7 @@ public class RelationCriteria extends AbstractArtifactSearchCriteria { if (relationType != null) { builder.append(relAlias); builder.append(".rel_link_type_id=? AND "); - builder.addParameter(relationType.getId()); + builder.addParameter(RelationTypeManager.getTypeId(relationType)); } builder.append(relAlias); |