More sanity checking.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2187 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2007-08-15 19:03:47 +00:00
parent c904aa1917
commit 242781749a
@@ -392,10 +392,10 @@ public abstract class DepotRepository
Class<T> type, final WhereClause key, CacheInvalidator invalidator, Object... fieldsValues) Class<T> type, final WhereClause key, CacheInvalidator invalidator, Object... fieldsValues)
throws PersistenceException throws PersistenceException
{ {
// sanity check
if (invalidator != null) { if (invalidator != null) {
invalidator.validateFlushType(type); invalidator.validateFlushType(type); // sanity check
} }
key.validateQueryType(type); // and another
// separate the arguments into keys and values // separate the arguments into keys and values
final String[] fields = new String[fieldsValues.length/2]; final String[] fields = new String[fieldsValues.length/2];
@@ -521,10 +521,10 @@ public abstract class DepotRepository
{ {
requireNotComputed(type, "updateLiteral"); requireNotComputed(type, "updateLiteral");
// sanity check
if (invalidator != null) { if (invalidator != null) {
invalidator.validateFlushType(type); invalidator.validateFlushType(type); // sanity check
} }
key.validateQueryType(type); // and another
// separate the arguments into keys and values // separate the arguments into keys and values
final String[] fields = new String[fieldsToValues.size()]; final String[] fields = new String[fieldsToValues.size()];
@@ -667,6 +667,11 @@ public abstract class DepotRepository
Class<T> type, final WhereClause key, CacheInvalidator invalidator) Class<T> type, final WhereClause key, CacheInvalidator invalidator)
throws PersistenceException throws PersistenceException
{ {
if (invalidator != null) {
invalidator.validateFlushType(type); // sanity check
}
key.validateQueryType(type); // and another
DeleteClause<T> delete = new DeleteClause<T>(type, key); DeleteClause<T> delete = new DeleteClause<T>(type, key);
final SQLBuilder builder = _ctx.getSQLBuilder(DepotTypes.getDepotTypes(_ctx, delete)); final SQLBuilder builder = _ctx.getSQLBuilder(DepotTypes.getDepotTypes(_ctx, delete));
builder.newQuery(delete); builder.newQuery(delete);