From 45a03ed42d0826e8473d09fd398bbecb2c53f3dd Mon Sep 17 00:00:00 2001 From: Par Winzell Date: Mon, 27 Aug 2007 16:22:46 +0000 Subject: [PATCH] Let's note what we're doing here. --- src/java/com/samskivert/jdbc/depot/FindAllQuery.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/java/com/samskivert/jdbc/depot/FindAllQuery.java b/src/java/com/samskivert/jdbc/depot/FindAllQuery.java index fe51482..26e4f4e 100644 --- a/src/java/com/samskivert/jdbc/depot/FindAllQuery.java +++ b/src/java/com/samskivert/jdbc/depot/FindAllQuery.java @@ -114,6 +114,7 @@ public abstract class FindAllQuery SQLExpression condition; if (_marsh.getPrimaryKeyFields().length == 1) { + // Single-column keys result in the compact IN(keyVal1, keyVal2, ...) Comparable[] keyFieldValues = new Comparable[fetchKeys.size()]; for (int ii = 0; ii < keyFieldValues.length; ii ++) { keyFieldValues[ii] = fetchKeys.get(ii).condition.getValues()[0]; @@ -121,6 +122,7 @@ public abstract class FindAllQuery condition = new In(_type, _marsh.getPrimaryKeyFields()[0], keyFieldValues); } else { + // Multi-column keys result in OR'd AND's, of unknown efficiency (TODO check). SQLExpression[] keyArray = new SQLExpression[fetchKeys.size()]; for (int ii = 0; ii < keyArray.length; ii ++) { keyArray[ii] = fetchKeys.get(ii).condition;