本文整理了Java中org.reveno.atp.api.domain.WriteableRepository.has()
方法的一些代码示例,展示了WriteableRepository.has()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WriteableRepository.has()
方法的具体详情如下:
包路径:org.reveno.atp.api.domain.WriteableRepository
类名称:WriteableRepository
方法名:has
暂无
代码示例来源:origin: dmart28/reveno
@Override
public <T> boolean has(Class<T> entityType, long id) {
return repository.has(entityType, id);
}
代码示例来源:origin: dmart28/reveno
@Override
public <T> boolean has(Class<T> entityType, long id) {
return underlyingRepo.has(entityType, id);
}
代码示例来源: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());
}
代码示例来源:origin: dmart28/reveno
@Test
public void testCommit() {
Bin item1 = new Bin("item1", "value1");
Bin item2 = new Bin("item2", "value2");
repository.begin();
repository.store(1L, item1);
repository.store(2L, item2);
Assert.assertTrue(repository.has(Bin.class, 1L));
Assert.assertTrue(repository.has(Bin.class, 2L));
Assert.assertFalse(underlyingRepository.has(Bin.class, 1L));
Assert.assertFalse(underlyingRepository.has(Bin.class, 2L));
repository.commit();
Assert.assertTrue(repository.has(Bin.class, 1L));
Assert.assertTrue(repository.has(Bin.class, 2L));
Assert.assertTrue(underlyingRepository.has(Bin.class, 1L));
Assert.assertTrue(underlyingRepository.has(Bin.class, 2L));
}
代码示例来源:origin: dmart28/reveno
@Test
public void testRollback() {
Bin item1 = new Bin("item1", "value1");
Bin item2 = new Bin("item2", "value2");
repository.begin();
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(underlyingRepository.has(Bin.class, 1L));
Assert.assertTrue(underlyingRepository.has(Bin.class, 2L));
repository.rollback();
Assert.assertFalse(underlyingRepository.has(Bin.class, 1L));
Assert.assertFalse(underlyingRepository.has(Bin.class, 2L));
Assert.assertFalse(repository.has(Bin.class, 1L));
Assert.assertFalse(repository.has(Bin.class, 2L));
}
代码示例来源:origin: dmart28/reveno
@Test
public void testRollback() {
Bin item1 = new Bin("item1", "value1");
Bin item2 = new Bin("item2", "value2");
repository.begin();
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.assertFalse(underlyingRepository.has(Bin.class, 1L));
Assert.assertFalse(underlyingRepository.has(Bin.class, 2L));
repository.rollback();
Assert.assertFalse(underlyingRepository.has(Bin.class, 1L));
Assert.assertFalse(underlyingRepository.has(Bin.class, 2L));
Assert.assertFalse(repository.has(Bin.class, 1L));
Assert.assertFalse(repository.has(Bin.class, 2L));
}
代码示例来源:origin: dmart28/reveno
repository.commit();
Assert.assertTrue(underlyingRepository.has(Bin.class, 1L));
Assert.assertTrue(underlyingRepository.has(Bin.class, 2L));
Assert.assertTrue(underlyingRepository.has(Record.class, 1L));
代码示例来源:origin: dmart28/reveno
repository.commit();
Assert.assertTrue(underlyingRepository.has(Bin.class, 1L));
Assert.assertTrue(underlyingRepository.has(Bin.class, 2L));
Assert.assertTrue(underlyingRepository.has(Record.class, 1L));
内容来源于网络,如有侵权,请联系作者删除!