本文整理匯總了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);
}
}