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 c54cc384e..7121ccda1 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 @@ -96,7 +96,12 @@ public abstract class AbstractDhRepo private void insert(TDTO dto) { this.queryDictionaryFirst(this.createInsertSql(dto)); } private void update(TDTO dto) { this.queryDictionaryFirst(this.createUpdateSql(dto)); } - public void delete(TDTO dto) { this.queryDictionaryFirst(this.createDeleteSql(dto)); } + public void delete(TDTO dto) { this.deleteByPrimaryKey(dto.getPrimaryKeyString()); } + public void deleteByPrimaryKey(String primaryKey) + { + String whereEqualStatement = this.createWherePrimaryKeyStatement(primaryKey); + this.queryDictionaryFirst("DELETE FROM "+this.getTableName()+" WHERE "+whereEqualStatement); + } public boolean exists(TDTO dto) { return this.existsWithPrimaryKey(dto.getPrimaryKeyString()); } public boolean existsWithPrimaryKey(String primaryKey)