diff --git a/core/src/main/java/com/seibel/distanthorizons/core/sql/AbstractDhRepo.java b/core/src/main/java/com/seibel/distanthorizons/core/sql/AbstractDhRepo.java index ff3eb8522..f72e6b988 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/sql/AbstractDhRepo.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/sql/AbstractDhRepo.java @@ -113,14 +113,14 @@ public abstract class AbstractDhRepo public void delete(TDTO dto) { this.deleteByPrimaryKey(dto.getPrimaryKeyString()); } public void deleteByPrimaryKey(String primaryKey) { - String whereEqualStatement = this.createWherePrimaryKeyStatement(primaryKey); + String whereEqualStatement = this.createWherePrimaryKeySql(primaryKey); this.queryDictionaryFirst("DELETE FROM "+this.getTableName()+" WHERE "+whereEqualStatement); } public boolean exists(TDTO dto) { return this.existsWithPrimaryKey(dto.getPrimaryKeyString()); } public boolean existsWithPrimaryKey(String primaryKey) { - String whereEqualStatement = this.createWherePrimaryKeyStatement(primaryKey); + String whereEqualStatement = this.createWherePrimaryKeySql(primaryKey); Map result = this.queryDictionaryFirst("SELECT EXISTS(SELECT 1 FROM "+this.getTableName()+" WHERE "+whereEqualStatement+") as 'existingCount';"); return result != null && (int)result.get("existingCount") != 0; } @@ -221,9 +221,9 @@ public abstract class AbstractDhRepo //================// /** Example: Id = '0' */ - public String createWherePrimaryKeyStatement(TDTO dto) { return this.createWherePrimaryKeyStatement(dto.getPrimaryKeyString()); } + public String createWherePrimaryKeySql(TDTO dto) { return this.createWherePrimaryKeySql(dto.getPrimaryKeyString()); } /** Example: Id = '0' */ - public String createWherePrimaryKeyStatement(String primaryKeyValue) { return this.getPrimaryKeyName()+" = '"+primaryKeyValue+"'"; } + public String createWherePrimaryKeySql(String primaryKeyValue) { return this.getPrimaryKeyName()+" = '"+primaryKeyValue+"'"; } public static List> convertResultSetToDictionaryList(ResultSet resultSet) throws SQLException { @@ -271,6 +271,4 @@ public abstract class AbstractDhRepo public abstract String createInsertSql(TDTO dto); public abstract String createUpdateSql(TDTO dto); - public abstract String createDeleteSql(TDTO dto); - } diff --git a/core/src/main/java/com/seibel/distanthorizons/core/sql/AbstractMetaDataRepo.java b/core/src/main/java/com/seibel/distanthorizons/core/sql/AbstractMetaDataRepo.java index ce0abae00..d19e8b194 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/sql/AbstractMetaDataRepo.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/sql/AbstractMetaDataRepo.java @@ -97,11 +97,5 @@ public abstract class AbstractMetaDataRepo extends AbstractDhRepo "WHERE DhSectionPos = '"+pos+"'"; } - @Override - public String createDeleteSql(MetaDataDto dto) - { - String pos = dto.pos.serialize(); - return "DELETE FROM "+this.getTableName()+" WHERE DhSectionPos = '"+pos+"'"; - } } diff --git a/core/src/test/java/testItems/sql/TestDataRepo.java b/core/src/test/java/testItems/sql/TestDataRepo.java index e9a36d869..4924e85c2 100644 --- a/core/src/test/java/testItems/sql/TestDataRepo.java +++ b/core/src/test/java/testItems/sql/TestDataRepo.java @@ -85,10 +85,4 @@ public class TestDataRepo extends AbstractDhRepo "WHERE Id = "+id; } - @Override - public String createDeleteSql(TestDto dto) - { - return "DELETE FROM "+this.getTableName()+" WHERE Id = '"+dto.id+"'"; - } - } diff --git a/core/src/test/java/tests/DhRepoSqliteTest.java b/core/src/test/java/tests/DhRepoSqliteTest.java index 2b4d0529b..bba8ece67 100644 --- a/core/src/test/java/tests/DhRepoSqliteTest.java +++ b/core/src/test/java/tests/DhRepoSqliteTest.java @@ -40,7 +40,7 @@ public class DhRepoSqliteTest @Test public void testFileSqlite() { - String dbFileName = "test_fullData.sqlite"; + String dbFileName = "test.sqlite"; File dbFile = new File(dbFileName);