當前位置: 首頁>>代碼示例>>Java>>正文


Java ExecutorType.REUSE屬性代碼示例

本文整理匯總了Java中org.apache.ibatis.session.ExecutorType.REUSE屬性的典型用法代碼示例。如果您正苦於以下問題:Java ExecutorType.REUSE屬性的具體用法?Java ExecutorType.REUSE怎麽用?Java ExecutorType.REUSE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.apache.ibatis.session.ExecutorType的用法示例。


在下文中一共展示了ExecutorType.REUSE屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: write

@Transactional(
    exceptionMessage = "usage sync job failed",
    executorType = ExecutorType.REUSE
)
private void write(List<Integer> neoNodeIdbatch) throws Exception {
  for (Integer id : neoNodeIdbatch) {
    NameUsage u = dao.readUsage(id);
    ParsedName pn = dao.readName(id);
    NameUsageMetrics m = dao.readMetrics(id);

    boolean insert = dao.isInsert(u);
    syncService.syncUsage(insert, u, pn, m);

    // remember usageKey and things about this record
    if (insert) {
      inserts.add(id);
    }
    usageKeys.put(id, u.getKey());
    // tell main importer about the new usageKey so we can prepare usages with good foreign keys
    dao.reportUsageKey(id, u.getKey());
  }
}
 
開發者ID:gbif,項目名稱:checklistbank,代碼行數:22,代碼來源:DatasetImportServiceMyBatis.java

示例2: call

@Override
@Transactional(
    exceptionMessage = "usage sync job failed",
    executorType = ExecutorType.REUSE
)
public List<NameUsage> call() throws Exception {
  LogContext.startDataset(datasetKey);
  LOG.debug("Starting usage sync with {} usages", usages.size());
  Iterator<ParsedName> nIter = names.iterator();
  for (NameUsage u : usages) {
    // pro parte usages are synonyms and do not have any descendants, synonyms, etc
    NameUsageMetrics m = new NameUsageMetrics();
    ParsedName pn = nIter.next();
    m.setKey(u.getKey());
    m.setNumDescendants(0);

    boolean insert = dao.isInsert(u);
    syncService.syncUsage(insert, u, pn, m);
  }
  LOG.debug("Completed batch of {} pro parte usages", usages.size());
  LogContext.endDataset();
  return usages;
}
 
開發者ID:gbif,項目名稱:checklistbank,代碼行數:23,代碼來源:DatasetImportServiceMyBatis.java

示例3: askForValidation

@Override
@Transactional(executorType = ExecutorType.REUSE)
public Map<String, Integer> askForValidation(List<String> urls) {
    return urls.stream().map((url) -> {
        Validation validation = new Validation();
        validation.setDate(new Date());
        validation.setUrl(validateUrl(url));
        validation.setStatus(Validation.Status.UNDEFINED);
        validationDao.insertValidation(validation);
        return validation;
    }).collect(Collectors.toMap(Validation::getUrl, Validation::getId));
}
 
開發者ID:avarabyeu,項目名稱:guicyspark,代碼行數:12,代碼來源:ValidationServiceImpl.java

示例4: deleteBatch

@Transactional(
    exceptionMessage = "usage deletion job failed",
    executorType = ExecutorType.REUSE
)
private void deleteBatch(List<Integer> batch) throws Exception {
  for (Integer key : batch) {
    syncService.delete(key);
  }
}
 
開發者ID:gbif,項目名稱:checklistbank,代碼行數:9,代碼來源:DatasetImportServiceMyBatis.java

示例5: updateForeignKeyBatch

@Transactional(
    exceptionMessage = "foreign key update job failed",
    executorType = ExecutorType.REUSE
)
private List<Integer> updateForeignKeyBatch(List<UsageForeignKeys> fks) {
  List<Integer> ids = Lists.newArrayList();
  for (UsageForeignKeys fk : fks) {
    // update usage by usage doing both potential updates in one statement
    syncService.updateForeignKeys(fk.getUsageKey(), fk.getParentKey(), fk.getBasionymKey());
    ids.add(fk.getUsageKey());
  }
  return ids;
}
 
開發者ID:gbif,項目名稱:checklistbank,代碼行數:13,代碼來源:DatasetImportServiceMyBatis.java


注:本文中的org.apache.ibatis.session.ExecutorType.REUSE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。