diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2009-02-10 19:54:31 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2009-02-10 19:54:31 +0000 |
commit | f9780b8b92778f5bd43cf1d21d83c1999060df56 (patch) | |
tree | 5c2bae220ab5ff535a972dc990cc1a6728b0ab1b /src/main/java/com/amazon/carbonado/repo | |
parent | b7e4a392f3fded6d025c8aba8ac8393538d7dff9 (diff) |
Fix for JDBC prepared statement values when query has an exists filter.
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(')');
|