diff --git a/src/java/com/samskivert/jdbc/depot/DepotRepository.java b/src/java/com/samskivert/jdbc/depot/DepotRepository.java index f2bdc73..d6fa9f3 100644 --- a/src/java/com/samskivert/jdbc/depot/DepotRepository.java +++ b/src/java/com/samskivert/jdbc/depot/DepotRepository.java @@ -821,9 +821,15 @@ public abstract class DepotRepository protected int deleteAll (Class type, final WhereClause where) throws DatabaseException { - // look up the primary keys for all rows matching our where clause and delete using those - KeySet pwhere = new KeySet(type, findAllKeys(type, true, where)); - return deleteAll(type, pwhere, pwhere); + if (_ctx.getMarshaller(type).hasPrimaryKey()) { + // look up the primary keys for all rows matching our where clause and delete using those + KeySet pwhere = new KeySet(type, findAllKeys(type, true, where)); + return deleteAll(type, pwhere, pwhere); + } else { + // otherwise just do the delete directly as we can't have cached a record that has no + // primary key in the first place + return deleteAll(type, where, null); + } } /**