org.hswebframework.ezorm.core.dsl.Query.nest()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(181)

本文整理了Java中org.hswebframework.ezorm.core.dsl.Query.nest方法的一些代码示例,展示了Query.nest的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.nest方法的具体详情如下:
包路径:org.hswebframework.ezorm.core.dsl.Query
类名称:Query
方法名:nest

Query.nest介绍

暂无

代码示例

代码示例来源:origin: hs-web/hsweb-framework

public DefaultLinkedRelations(ServiceContext serviceContext, Supplier<List<String>> targetIdSupplier) {
  this.serviceContext = serviceContext;
  this.targetIdSupplier = targetIdSupplier;
  query = Query.<PersonEntity, QueryParamEntity>empty(new QueryParamEntity()).nest();
}

代码示例来源:origin: hs-web/hsweb-framework

@GetMapping("/{type}/form/{processDefineId}")
@ApiOperation("获取自己可查看的流程表单数据")
@Authorize(merge = false)
@SuppressWarnings("all")
public ResponseMessage<PagerResult<Object>> getFormData(@PathVariable Type type,
                            @PathVariable String processDefineId,
                            QueryParamEntity query,
                            Authentication authentication) {
  Query.empty(query)
      .nest()
      .when(type != null, q -> type.applyQueryTerm(q, authentication.getUser().getId()))
      .end();
  return ResponseMessage.ok(workFlowFormService.selectProcessForm(processDefineId, query));
}

代码示例来源:origin: hs-web/hsweb-framework

/**
 * 将已有的条件包装到一个嵌套的条件里,并返回一个Query对象.例如:
 * <pre>
 *     entity.toNestQuery(query->query.and("userId",userId));
 * </pre>
 * <p>
 * 原有条件: name=? or type=?
 * <p>
 * 执行后条件: userId=? (name=? or type=?)
 *
 * @param before 在包装之前执行,将条件包装到已有条件之前
 * @since 3.0.4
 */
public <T> Query<T, QueryParamEntity> toNestQuery(Consumer<Query<T, QueryParamEntity>> before) {
  List<Term> terms = getTerms();
  setTerms(new ArrayList<>());
  Query<T, QueryParamEntity> query = toQuery();
  if (null != before) {
    before.accept(query);
  }
  return query
      .nest()
      .each(terms, NestConditional::accept)
      .end();
}

代码示例来源:origin: hs-web/hsweb-framework

(currentType.equals("or") ? conditional.orNest() : conditional.nest()) :
    (currentType.equals("or") ? nest.orNest() : nest.nest()));
len = 0;

代码示例来源:origin: hs-web/hsweb-framework

.nest()
.is(RelationInfoEntity.relationFrom, target)
.or(RelationInfoEntity.relationTo, target)

代码示例来源:origin: hs-web/hsweb-framework

public Stream<Relation> relationStream(Supplier<List<String>> supplier) {
  List<String> personIdList = supplier.get();
  QueryParamEntity queryParamEntity = query.end()
      .and()
      .nest()
      .in("relationFrom", personIdList)
      .or()
      .in("relationTo", personIdList)
      .end()
      .getParam();
  return serviceContext.getRelationInfoService().select(queryParamEntity).stream()
      .map(info -> {
        SimpleRelation relation = new SimpleRelation();
        relation.setTarget(info.getRelationTo());
        relation.setTargetObject(RelationTargetHolder.get(info.getRelationTypeTo(), info.getRelationTo()).orElse(null));
        relation.setRelation(info.getRelationId());
        if (personIdList.contains(info.getRelationFrom())) {
          relation.setDimension(info.getRelationTypeFrom());
          relation.setDirection(Relation.Direction.POSITIVE);
        } else {
          relation.setDimension(info.getRelationTypeTo());
          relation.setDirection(Relation.Direction.REVERSE);
        }
        return relation;
      });
}

代码示例来源:origin: org.hswebframework.web/hsweb-system-workflow-local

@GetMapping("/{type}/form/{processDefineId}")
@ApiOperation("获取自己可查看的流程表单数据")
@Authorize(merge = false)
@SuppressWarnings("all")
public ResponseMessage<PagerResult<Object>> getFormData(@PathVariable Type type,
                            @PathVariable String processDefineId,
                            QueryParamEntity query,
                            Authentication authentication) {
  Query.empty(query)
      .nest()
      .when(type != null, q -> type.applyQueryTerm(q, authentication.getUser().getId()))
      .end();
  return ResponseMessage.ok(workFlowFormService.selectProcessForm(processDefineId, query));
}

相关文章