From 74675a7e573d2361c0798d41a7098b250fe80996 Mon Sep 17 00:00:00 2001 From: mdb Date: Fri, 15 Jun 2007 01:13:28 +0000 Subject: [PATCH] Add a delete() that takes a Key. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2115 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../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 9aa77bb2..501dbfeb 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); }