Skip to content

Commit

Permalink
IN query need to return list conditions
Browse files Browse the repository at this point in the history
Change-Id: I24eec52bc98e456e2e968aae992187e97d725b33
  • Loading branch information
javeme committed Jan 20, 2022
1 parent 587670b commit 8cd4970
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ public <T> T condition(Object key) {
T value = (T) valuesEQ.get(0);
return value;
}
if (valuesEQ.size() == 0 && valuesIN.size() == 1) {
@SuppressWarnings("unchecked")
T value = (T) valuesIN.get(0);
return value;
}

Set<Object> intersectValues = InsertionOrderUtil.newSet();
for (Object value : valuesEQ) {
Expand All @@ -263,6 +268,12 @@ public <T> T condition(Object key) {
valueAsList);
}
}

if (valuesIN.size() > 0) {
@SuppressWarnings("unchecked")
T value = (T) intersectValues;
return value;
}
E.checkState(intersectValues.size() == 1,
"Illegal key '%s' with more than one value: %s",
key, intersectValues);
Expand Down

0 comments on commit 8cd4970

Please sign in to comment.