From 15f3d6be4dc8700546846dd02305a620ccd0fa3f Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 15 Jun 2007 01:13:28 +0000 Subject: [PATCH] Add a delete() that takes a Key. --- .../com/samskivert/jdbc/depot/DepotRepository.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/java/com/samskivert/jdbc/depot/DepotRepository.java b/src/java/com/samskivert/jdbc/depot/DepotRepository.java index 9aa77bb..501dbfe 100644 --- a/src/java/com/samskivert/jdbc/depot/DepotRepository.java +++ b/src/java/com/samskivert/jdbc/depot/DepotRepository.java @@ -609,7 +609,18 @@ public class DepotRepository protected int delete (Class type, Comparable primaryKeyValue) throws PersistenceException { - Key primaryKey = _ctx.getMarshaller(type).makePrimaryKey(primaryKeyValue); + return delete(type, _ctx.getMarshaller(type).makePrimaryKey(primaryKeyValue)); + } + + /** + * Deletes all persistent objects from the database with a primary key matching the supplied + * primary key. + * + * @return the number of rows deleted by this action. + */ + protected int delete (Class type, Key primaryKey) + throws PersistenceException + { return deleteAll(type, primaryKey, primaryKey); }