org.molgenis.data.Query.ge()方法的使用及代码示例

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

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

Query.ge介绍

暂无

代码示例

代码示例来源:origin: org.molgenis/molgenis-core-ui

@GetMapping(value = "/latest", produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public List<Entity> findLastJobs() {
 final List<Entity> jobs = new ArrayList<>();
 Instant weekAgo = Instant.now().minus(7, ChronoUnit.DAYS).truncatedTo(ChronoUnit.DAYS);
 User currentUser = userAccountService.getCurrentUser();
 dataService
   .getMeta()
   .getEntityTypes()
   .filter(this::isAllowedJobExecutionEntityType)
   .forEach(
     e -> {
      Query<Entity> q =
        dataService.query(e.getId()).ge(JobExecutionMetaData.SUBMISSION_DATE, weekAgo);
      if (!currentUser.isSuperuser()) {
       q.and().eq(USER, currentUser.getUsername());
      }
      dataService.findAll(e.getId(), q).forEach(jobs::add);
     });
 jobs.sort(
   (job1, job2) ->
     job2.getInstant(SUBMISSION_DATE).compareTo(job1.getInstant(SUBMISSION_DATE)));
 if (jobs.size() > MAX_JOBS_TO_RETURN) {
  return jobs.subList(0, MAX_JOBS_TO_RETURN);
 }
 return jobs;
}

代码示例来源:origin: org.molgenis/molgenis-das

protected Stream<Entity> queryDataSet(String segmentId, int browserStart, int browserStop, String dataSet,
    int maxbins)
{
  String chromosomeAttribute = config.getAttributeNameForAttributeNameArray(GenomicDataSettings.Meta.ATTRS_CHROM,
      dataService.getEntityType(dataSet));
  String posAttr = config.getAttributeNameForAttributeNameArray(GenomicDataSettings.Meta.ATTRS_POS,
      dataService.getEntityType(dataSet));
  String stopAttr = config.getAttributeNameForAttributeNameArray(GenomicDataSettings.Meta.ATTRS_STOP,
      dataService.getEntityType(dataSet));
  //Query for chromosome
  Query<Entity> q = new QueryImpl<>().eq(chromosomeAttribute, segmentId);
  //Add postion queryparts, those should be nested
  q.and().nest();
  //Add start position to queryparts
  q.le(posAttr, browserStop);
  //If stop is configured: add stop querypart, else the position should also be greater than browserstart
  if (stopAttr != "")
  {
    q.and().ge(stopAttr, browserStart);
  }
  else
  {
    q.and().ge(posAttr, browserStart);
  }
  q.unnest();
  //add pagesize based on maxbins of das query
  q.pageSize(maxbins);
  return dataService.findAll(dataSet, q);
}

相关文章