Let's note what we're doing here.
This commit is contained in:
@@ -114,6 +114,7 @@ public abstract class FindAllQuery<T extends PersistentRecord>
|
|||||||
SQLExpression condition;
|
SQLExpression condition;
|
||||||
|
|
||||||
if (_marsh.getPrimaryKeyFields().length == 1) {
|
if (_marsh.getPrimaryKeyFields().length == 1) {
|
||||||
|
// Single-column keys result in the compact IN(keyVal1, keyVal2, ...)
|
||||||
Comparable[] keyFieldValues = new Comparable[fetchKeys.size()];
|
Comparable[] keyFieldValues = new Comparable[fetchKeys.size()];
|
||||||
for (int ii = 0; ii < keyFieldValues.length; ii ++) {
|
for (int ii = 0; ii < keyFieldValues.length; ii ++) {
|
||||||
keyFieldValues[ii] = fetchKeys.get(ii).condition.getValues()[0];
|
keyFieldValues[ii] = fetchKeys.get(ii).condition.getValues()[0];
|
||||||
@@ -121,6 +122,7 @@ public abstract class FindAllQuery<T extends PersistentRecord>
|
|||||||
condition = new In(_type, _marsh.getPrimaryKeyFields()[0], keyFieldValues);
|
condition = new In(_type, _marsh.getPrimaryKeyFields()[0], keyFieldValues);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
// Multi-column keys result in OR'd AND's, of unknown efficiency (TODO check).
|
||||||
SQLExpression[] keyArray = new SQLExpression[fetchKeys.size()];
|
SQLExpression[] keyArray = new SQLExpression[fetchKeys.size()];
|
||||||
for (int ii = 0; ii < keyArray.length; ii ++) {
|
for (int ii = 0; ii < keyArray.length; ii ++) {
|
||||||
keyArray[ii] = fetchKeys.get(ii).condition;
|
keyArray[ii] = fetchKeys.get(ii).condition;
|
||||||
|
|||||||
Reference in New Issue
Block a user