Don't try to do the primary key lookup on delete for records that define no

primary key.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2408 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
samskivert
2008-09-08 19:01:30 +00:00
parent ae552d1696
commit e0d3f6b2c9
@@ -821,9 +821,15 @@ public abstract class DepotRepository
protected <T extends PersistentRecord> int deleteAll (Class<T> type, final WhereClause where)
throws DatabaseException
{
// look up the primary keys for all rows matching our where clause and delete using those
KeySet<T> pwhere = new KeySet<T>(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<T> pwhere = new KeySet<T>(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);
}
}
/**