示例#1
0
 @Override
 public Predicate createRelatedToSearch(IRelationTypeSide relationTypeSide, Collection<?> ids) {
   List<String> values = new LinkedList<>();
   String side = relationTypeSide.getSide().isSideA() ? "A" : "B";
   for (Object id : ids) {
     if (id instanceof IArtifactToken) {
       values.add(((IArtifactToken) id).getGuid());
     } else if (id instanceof Integer) {
       values.add(id.toString());
     }
   }
   return new Predicate(
       SearchMethod.RELATED_TO,
       Arrays.asList(side + relationTypeSide.getGuid().toString()),
       values);
 }
示例#2
0
 @Override
 public Predicate createRelationTypeSideNotExistsSearch(IRelationTypeSide relationTypeSide) {
   String side = relationTypeSide.getSide().isSideA() ? "A" : "B";
   return new Predicate(
       SearchMethod.NOT_EXISTS_TYPE,
       Arrays.asList("relTypeSide", side),
       getLongIds(relationTypeSide));
 }