Add Repo.exists()

This commit is contained in:
James Seibel
2023-10-02 21:43:36 -05:00
parent d1df845e79
commit 30cf937539
2 changed files with 18 additions and 1 deletions
@@ -91,6 +91,10 @@ public class DhRepoSqliteTest
Assert.assertEquals("get/insert failed, not equal", insertDto.id, getDto.id);
Assert.assertEquals("get/insert failed, not equal", insertDto.value, getDto.value);
// exists - DTO present
Assert.assertTrue("DTO exists failed", testDataRepo.exists(insertDto));
Assert.assertTrue("DTO exists failed", testDataRepo.existsWithPrimaryKey(insertDto.getPrimaryKeyString()));
// update
TestDto updateMetaFile = new TestDto(0, "b");
@@ -110,6 +114,10 @@ public class DhRepoSqliteTest
getDto = testDataRepo.getByPrimaryKey("0");
Assert.assertNull("delete failed, not null returned", getDto);
// exists - DTO absent
Assert.assertFalse("DTO exists failed", testDataRepo.exists(insertDto));
Assert.assertFalse("DTO exists failed", testDataRepo.existsWithPrimaryKey(insertDto.getPrimaryKeyString()));
}
catch (SQLException e)
{