当前位置: 首页>>代码示例>>Java>>正文


Java MotechDataService.retrieveAll方法代码示例

本文整理汇总了Java中org.motechproject.mds.service.MotechDataService.retrieveAll方法的典型用法代码示例。如果您正苦于以下问题:Java MotechDataService.retrieveAll方法的具体用法?Java MotechDataService.retrieveAll怎么用?Java MotechDataService.retrieveAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.motechproject.mds.service.MotechDataService的用法示例。


在下文中一共展示了MotechDataService.retrieveAll方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: stressTestRetrieval

import org.motechproject.mds.service.MotechDataService; //导入方法依赖的package包/类
private void stressTestRetrieval(MotechDataService service) {

        Long startTime = System.nanoTime();
        service.retrieveAll();
        Long endTime = (System.nanoTime() - startTime) / 1000000;

        LOGGER.info("MDS Service: Retrieving all instances took " + endTime + "ms.");
        logToFile((double) endTime);
    }
 
开发者ID:motech,项目名称:motech,代码行数:10,代码来源:MdsStressIT.java

示例2: stressTestUpdating

import org.motechproject.mds.service.MotechDataService; //导入方法依赖的package包/类
private void stressTestUpdating(MotechDataService service) {
    List<Object> allObjects = service.retrieveAll();

    Long startTime = System.nanoTime();
    for (Object object : allObjects) {
        service.update(object);
    }
    Long endTime = (System.nanoTime() - startTime) / 1000000;

    LOGGER.info("MDS Service: Updating " + TEST_INSTANCES + " instances took " + endTime + "ms.");
    logToFile((double) endTime);
}
 
开发者ID:motech,项目名称:motech,代码行数:13,代码来源:MdsStressIT.java

示例3: stressTestDeleting

import org.motechproject.mds.service.MotechDataService; //导入方法依赖的package包/类
private void stressTestDeleting(MotechDataService service) {

        Long startTime = System.nanoTime();
        for (Object object : service.retrieveAll()) {
            service.delete(object);
        }
        Long endTime = (System.nanoTime() - startTime) / 1000000;

        LOGGER.info("MDS Service: Deleting " + TEST_INSTANCES + " instances took " + endTime + "ms.");
        logToFile((double) endTime);
    }
 
开发者ID:motech,项目名称:motech,代码行数:12,代码来源:MdsStressIT.java

示例4: retrieveAll

import org.motechproject.mds.service.MotechDataService; //导入方法依赖的package包/类
@Override
public <T> List<T> retrieveAll(String entityClassName, QueryParams queryParams) {
    MotechDataService<T> dataService = OSGiServiceUtils.findService(bundleContext,
            MotechClassPool.getInterfaceName(entityClassName));

    return dataService.retrieveAll(queryParams);
}
 
开发者ID:motech,项目名称:motech,代码行数:8,代码来源:MdsLookupServiceImpl.java

示例5: queryAndUpdate

import org.motechproject.mds.service.MotechDataService; //导入方法依赖的package包/类
@Override
public void queryAndUpdate(Map<String, Object> parameters) throws ActionHandlerException {
    LOGGER.debug("Action QUERY AND UPDATE: params {}", parameters);

    String entityClassName = getEntityClassName(parameters);
    MotechDataService dataService = getEntityDataService(entityClassName);
    Entity entity = getEntity(entityClassName);

    List<?> instances =  dataService.retrieveAll();

    for (Object instance : instances) {
        setInstancePropertiesForQuery(instance, entity.getFields(), parameters);
        dataService.update(instance);
    }
}
 
开发者ID:motech,项目名称:motech,代码行数:16,代码来源:ActionHandlerServiceImpl.java

示例6: exportData

import org.motechproject.mds.service.MotechDataService; //导入方法依赖的package包/类
protected long exportData(EntityInfo entityInfo, TableWriter writer, String lookupName, QueryParams params, List<String> headers,
                       Map<String, Object> lookupFields, CsvExportCustomizer exportCustomizer) {
    final MotechDataService dataService = DataServiceHelper.getDataService(bundleContext, entityInfo.getClassName());

    final Map<String, FieldDto> fieldMap = new HashMap<>();
    for (FieldDto field : entityInfo.getFieldDtos()) {
        fieldMap.put(exportCustomizer.exportDisplayName(field), field);
    }

    // we must respect field ordering
    String[] orderedHeaders = orderHeaders(entityInfo.getAdvancedSettings().getBrowsing(), headers == null ? fieldsToHeaders(entityInfo.getFieldDtos(), exportCustomizer) : headers.toArray(new String[headers.size()]),
            entityInfo.getFieldDtos(), exportCustomizer);

    try {
        writer.writeHeader(orderedHeaders);

        long rowsExported = 0;
        Map<String, String> row = new HashMap<>();

        List<Object> instances = StringUtils.isBlank(lookupName) ? dataService.retrieveAll(params) :
                mdsLookupService.findMany(entityInfo.getClassName(), lookupName, lookupFields, params);

        for (Object instance : instances) {
            buildCsvRow(row, fieldMap, instance, orderedHeaders, exportCustomizer);
            writer.writeRow(row, orderedHeaders);
            rowsExported++;
        }

        return rowsExported;
    } catch (IOException e) {
        throw new DataExportException("IO Error when writing data", e);
    }
}
 
开发者ID:motech,项目名称:motech,代码行数:34,代码来源:AbstractMdsExporter.java

示例7: getEntityRecords

import org.motechproject.mds.service.MotechDataService; //导入方法依赖的package包/类
@Override
public List<BasicEntityRecord> getEntityRecords(Long entityId, QueryParams queryParams) {
    EntityDto entity = getEntity(entityId);
    validateCredentialsForReading(entity);
    List<FieldDto> fields = entityService.getEntityFieldsForUI(entityId);

    MotechDataService service = getServiceForEntity(entity);
    List instances = service.retrieveAll(queryParams);
    updateGridSize(entityId, queryParams);

    return instancesToBasicRecords(instances, entity, fields, service, EntityType.STANDARD);
}
 
开发者ID:motech,项目名称:motech,代码行数:13,代码来源:InstanceServiceImpl.java


注:本文中的org.motechproject.mds.service.MotechDataService.retrieveAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。