本文整理汇总了Java中org.motechproject.mds.service.MotechDataService.delete方法的典型用法代码示例。如果您正苦于以下问题:Java MotechDataService.delete方法的具体用法?Java MotechDataService.delete怎么用?Java MotechDataService.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.motechproject.mds.service.MotechDataService
的用法示例。
在下文中一共展示了MotechDataService.delete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: delete
import org.motechproject.mds.service.MotechDataService; //导入方法依赖的package包/类
@Override
public void delete(Map<String, Object> parameters) throws ActionHandlerException {
LOGGER.debug("Action DELETE: params: {}", parameters);
String entityClassName = getEntityClassName(parameters);
MotechDataService dataService = getEntityDataService(entityClassName);
Long instanceId = getInstanceId(parameters, true);
Object instance = retrieveEntityInstance(dataService, instanceId);
dataService.delete(instance);
}
示例3: deleteInstance
import org.motechproject.mds.service.MotechDataService; //导入方法依赖的package包/类
@Override
public void deleteInstance(Long entityId, Long instanceId) {
EntityDto entity = getEntity(entityId);
validateCredentials(entity);
validateNonEditableProperty(entity);
MotechDataService service = getServiceForEntity(entity);
service.delete(ID_FIELD_NAME, instanceId);
}
示例4: deleteSelectedInstances
import org.motechproject.mds.service.MotechDataService; //导入方法依赖的package包/类
@Override
public void deleteSelectedInstances(Long entityId, List<Long> instanceIds) {
EntityDto entity = getEntity(entityId);
validateCredentials(entity);
validateNonEditableProperty(entity);
MotechDataService service = getServiceForEntity(entity);
for (Long instanceId : instanceIds) {
service.delete(ID_FIELD_NAME, instanceId);
}
}