From 242781749a9356a4cf47fd2d69ee28a4ae821b4e Mon Sep 17 00:00:00 2001 From: mdb Date: Wed, 15 Aug 2007 19:03:47 +0000 Subject: [PATCH] More sanity checking. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2187 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../com/samskivert/jdbc/depot/DepotRepository.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/java/com/samskivert/jdbc/depot/DepotRepository.java b/src/java/com/samskivert/jdbc/depot/DepotRepository.java index 9a174a29..1bb5a20b 100644 --- a/src/java/com/samskivert/jdbc/depot/DepotRepository.java +++ b/src/java/com/samskivert/jdbc/depot/DepotRepository.java @@ -392,10 +392,10 @@ public abstract class DepotRepository Class type, final WhereClause key, CacheInvalidator invalidator, Object... fieldsValues) throws PersistenceException { - // sanity check if (invalidator != null) { - invalidator.validateFlushType(type); + invalidator.validateFlushType(type); // sanity check } + key.validateQueryType(type); // and another // separate the arguments into keys and values final String[] fields = new String[fieldsValues.length/2]; @@ -521,10 +521,10 @@ public abstract class DepotRepository { requireNotComputed(type, "updateLiteral"); - // sanity check if (invalidator != null) { - invalidator.validateFlushType(type); + invalidator.validateFlushType(type); // sanity check } + key.validateQueryType(type); // and another // separate the arguments into keys and values final String[] fields = new String[fieldsToValues.size()]; @@ -667,6 +667,11 @@ public abstract class DepotRepository Class type, final WhereClause key, CacheInvalidator invalidator) throws PersistenceException { + if (invalidator != null) { + invalidator.validateFlushType(type); // sanity check + } + key.validateQueryType(type); // and another + DeleteClause delete = new DeleteClause(type, key); final SQLBuilder builder = _ctx.getSQLBuilder(DepotTypes.getDepotTypes(_ctx, delete)); builder.newQuery(delete);