org.reveno.atp.api.domain.WriteableRepository.getEntities()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(96)

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

WriteableRepository.getEntities介绍

暂无

代码示例

代码示例来源:origin: dmart28/reveno

@Override
public Map<Long, Object> getEntities(Class<?> entityType) {
  return repository.getEntities(entityType);
}

代码示例来源:origin: dmart28/reveno

@Override
public Map<Long, Object> getEntitiesClean(Class<?> entityType) {
  return repository.getEntities(entityType);
}

代码示例来源:origin: dmart28/reveno

@Override
public Map<Long, Object> getEntities(Class<?> entityType) {
  Map<Long, Object> result = underlyingRepo.getEntities(entityType);
  if (readMarking) {
    markedRecords.get(entityType).putAll(result);
  }
  return result;
}

代码示例来源:origin: dmart28/reveno

@Override
public Map<Long, Object> getEntities(Class<?> entityType) {
  Map<Long, Object> entities = repository.getEntities(entityType);
  if (isTransaction.get())
    entities.forEach((id, e) -> saveEntityState(id, entityType, e, EntityRecoveryState.UPDATE));
  return entities;
}

代码示例来源:origin: dmart28/reveno

@Override
public Map<Long, Object> getEntities(Class<?> entityType) {
  Map<Long, Object> entities = repository.getEntities(entityType);
  if (isTransaction.get()) {
    Set<Map.Entry<Long, Object>> notRemoved;
    if (removed.size() > 0 && removed.get(entityType).size() > 0) {
      notRemoved = entities.entrySet()
          .stream().filter(e -> !isDeleted(entityType, e.getKey()))
          .collect(Collectors.toSet());
    } else {
      notRemoved = entities.entrySet().stream().collect(Collectors.toSet());
    }
    if (added.size() > 0 && added.get(entityType).size() > 0)
      notRemoved.addAll(added.get(entityType).entrySet());
    return notRemoved.stream().collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
  } else
    return entities;
}

代码示例来源:origin: dmart28/reveno

@Test
public void testBasic() {
  Bin item1 = new Bin("item1", "value1");
  Bin item2 = new Bin("item2", "value2");
  
  repository.store(1L, item1);
  repository.store(2L, item2);
  
  Assert.assertTrue(repository.has(Bin.class, 1L));
  Assert.assertTrue(repository.has(Bin.class, 2L));
  Assert.assertFalse(repository.has(Bin.class, 3L));
  
  Assert.assertTrue(repository.has(Bin.class, 1L));
  Assert.assertTrue(repository.has(Bin.class, 2L));
  
  repository.remove(Bin.class, 2L);
  Assert.assertEquals(1, repository.getEntities(Bin.class).size());
  
  Record rec = new Record();
  repository.store(1L, rec);
  repository.store(2L, item2);
  
  Assert.assertEquals(2, repository.getData().data.size());
  Assert.assertEquals(2, repository.getEntities(Bin.class).size());
  Assert.assertEquals(1, repository.getEntities(Record.class).size());
}

相关文章