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

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

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

Query.or介绍

暂无

代码示例

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

@RequestMapping(method = RequestMethod.POST, value = "/getmapping", produces = APPLICATION_JSON_VALUE)
@ResponseBody
public SearchResult getMappings(@RequestBody
Map<String, Object> request)
{
  if (request.get("dataSetIdentifier") == null) return new SearchResult("dataSetId cannot be null!");
  Object dataSetIdentifier = request.get("dataSetIdentifier");
  Object featureIds = request.get("featureIds");
  Query query = new QueryImpl();
  if (featureIds != null && !featureIds.toString().isEmpty())
  {
    if (query.getRules().size() > 0) query.or();
    for (Object featureId : (List<?>) featureIds)
    {
      query.eq(AsyncOntologyMatcher.STORE_MAPPING_FEATURE, featureId.toString());
    }
  }
  return searchService.search(new SearchRequest(dataSetIdentifier.toString(), query, null));
}

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

query.or();

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

@Transactional(readOnly = true)
@Override
public List<Resource> findResources(String query) {
 Stream<Resource> packageResources =
   dataService
     .query(PackageMetadata.PACKAGE, Package.class)
     .search(PackageMetadata.LABEL, query)
     .or()
     .search(PackageMetadata.DESCRIPTION, query)
     .findAll()
     .map(this::toResource);
 Stream<Resource> entityTypeResources =
   dataService
     .query(ENTITY_TYPE_META_DATA, EntityType.class)
     .search(EntityTypeMetadata.LABEL, query)
     .or()
     .search(EntityTypeMetadata.DESCRIPTION, query)
     .findAll()
     .map(this::toResource);
 return Streams.concat(packageResources, entityTypeResources).collect(toList());
}

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

private void bootstrap(SystemEntityType systemEntityType) {
 dataService
   .query(systemEntityType.getId())
   .eq(STATUS, RUNNING)
   .or()
   .eq(STATUS, PENDING)
   .findAll()
   .forEach(this::setFailed);
}

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

@Override
public EntitiesValidationReport validateImport(File file, RepositoryCollection source) {
 EntitiesValidationReport report = new EntitiesValidationReportImpl();
 if (source.getRepository(ONTOLOGY) == null)
  throw new MolgenisDataException("Exception Repository [" + ONTOLOGY + "] is missing");
 boolean ontologyExists = false;
 for (Entity ontologyEntity : source.getRepository(ONTOLOGY)) {
  String ontologyIRI = ontologyEntity.getString(OntologyMetaData.ONTOLOGY_IRI);
  String ontologyName = ontologyEntity.getString(OntologyMetaData.ONTOLOGY_NAME);
  Entity ontologyQueryEntity =
    dataService.findOne(
      ONTOLOGY,
      new QueryImpl<>()
        .eq(OntologyMetaData.ONTOLOGY_IRI, ontologyIRI)
        .or()
        .eq(OntologyMetaData.ONTOLOGY_NAME, ontologyName));
  ontologyExists = ontologyQueryEntity != null;
 }
 if (ontologyExists)
  throw new MolgenisDataException("The ontology you are trying to import already exists");
 for (String entityTypeId : source.getEntityTypeIds()) {
  report.getSheetsImportable().put(entityTypeId, !ontologyExists);
 }
 return report;
}

相关文章