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

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

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

Query.fetch介绍

暂无

代码示例

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

@Override
public void forEachBatched(Fetch fetch, Consumer<List<Entity>> consumer, int batchSize) {
 final Stopwatch stopwatch = createStarted();
 final JdbcTemplate template = new JdbcTemplate(dataSource);
 template.setFetchSize(batchSize);
 final Query<Entity> query = new QueryImpl<>();
 if (fetch != null) {
  query.fetch(fetch);
 }
 final String allRowsSelect = getSqlSelect(entityType, query, emptyList(), false);
 LOG.debug("Fetching [{}] data...", getName());
 LOG.trace("SQL: {}", allRowsSelect);
 RowMapper<Entity> rowMapper = postgreSqlEntityFactory.createRowMapper(entityType, fetch);
 template.query(
   allRowsSelect,
   (ResultSetExtractor<Object>)
     resultSet -> processResultSet(consumer, batchSize, entityType, rowMapper, resultSet));
 LOG.debug("Streamed entire repository in batches of size {} in {}.", batchSize, stopwatch);
}

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

@Override
public Iterable<String> getEntityTypeIds() {
 return dataService
     .query(ENTITY_TYPE_META_DATA, EntityType.class)
     .eq(BACKEND, POSTGRESQL)
     .fetch(getEntityTypeFetch())
     .findAll()
     .map(EntityType::getId)
   ::iterator;
}

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

@Override
public Iterator<Repository<Entity>> iterator() {
 return dataService
   .query(ENTITY_TYPE_META_DATA, EntityType.class)
   .eq(BACKEND, POSTGRESQL)
   .and()
   .eq(IS_ABSTRACT, false)
   .fetch(getEntityTypeFetch())
   .findAll()
   .map(this::getRepository)
   .iterator();
}

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

@Override
public Entity findOneById(Object id, Fetch fetch) {
 if (id == null) {
  return null;
 }
 return findOne(new QueryImpl<>().eq(entityType.getIdAttribute().getName(), id).fetch(fetch));
}

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

@Override
public Repository<Entity> getRepository(String id) {
 EntityType entityType =
   dataService
     .query(ENTITY_TYPE_META_DATA, EntityType.class)
     .eq(BACKEND, POSTGRESQL)
     .and()
     .eq(ID, id)
     .and()
     .eq(IS_ABSTRACT, false)
     .fetch(getEntityTypeFetch())
     .findOne();
 return getRepository(entityType);
}

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

request.getAttrs(), entityType, LocaleContextHolder.getLocale().getLanguage());
if (fetch != null) {
 q.fetch(fetch);

相关文章