summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado/cursor
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/amazon/carbonado/cursor')
-rw-r--r--src/main/java/com/amazon/carbonado/cursor/FilteredCursorGenerator.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/com/amazon/carbonado/cursor/FilteredCursorGenerator.java b/src/main/java/com/amazon/carbonado/cursor/FilteredCursorGenerator.java
index 04ea2e8..dba2062 100644
--- a/src/main/java/com/amazon/carbonado/cursor/FilteredCursorGenerator.java
+++ b/src/main/java/com/amazon/carbonado/cursor/FilteredCursorGenerator.java
@@ -464,18 +464,23 @@ class FilteredCursorGenerator {
/**
* Generated code checks if chained properties resolve to null, and if
- * so, branches to the current scope's fail location.
+ * so, branches to the current scope's fail or success location.
*/
private void loadChainedProperty(CodeBuilder b, ChainedProperty<?> chained) {
b.loadLocal(mStorableVar);
loadProperty(b, chained.getPrimeProperty());
for (int i=0; i<chained.getChainCount(); i++) {
- // Check if last loaded property was null, and fail if so.
+ // Check if last loaded property was null. Fail for inner join,
+ // success for outer join.
b.dup();
Label notNull = b.createLabel();
b.ifNullBranch(notNull, false);
b.pop();
- getScope().fail(b);
+ if (chained.isOuterJoin(i)) {
+ getScope().success(b);
+ } else {
+ getScope().fail(b);
+ }
notNull.setLocation();
// Now load next property in chain.