diff options
Diffstat (limited to 'src/main/java/com/amazon/carbonado/repo')
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/jdbc/WhereBuilder.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/WhereBuilder.java b/src/main/java/com/amazon/carbonado/repo/jdbc/WhereBuilder.java index 80f895e..9023397 100644 --- a/src/main/java/com/amazon/carbonado/repo/jdbc/WhereBuilder.java +++ b/src/main/java/com/amazon/carbonado/repo/jdbc/WhereBuilder.java @@ -208,13 +208,24 @@ class WhereBuilder<S extends Storable> extends Visitor<S, FetchException, Object if (subFilter != null && !subFilter.isOpen()) {
mStatementBuilder.append(" AND (");
+
WhereBuilder wb = new WhereBuilder
(mStatementBuilder, oneToManyNode, mAliasGenerator);
+
FetchException e = (FetchException) subFilter.accept(wb, null);
if (e != null) {
return e;
}
+
mStatementBuilder.append(')');
+
+ // Transfer property filters from sub-builder as joined from exists filter.
+ int size = wb.mPropertyFilters.size();
+ for (int i=0; i<size; i++) {
+ PropertyFilter propFilter = (PropertyFilter) wb.mPropertyFilters.get(i);
+ mPropertyFilters.add(propFilter.asJoinedFromAny(chained));
+ }
+ mPropertyFilterNullable.addAll(wb.mPropertyFilterNullable);
}
mStatementBuilder.append(')');
|