summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado/cursor
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2007-10-26 21:24:43 +0000
committerBrian S. O'Neill <bronee@gmail.com>2007-10-26 21:24:43 +0000
commit4063328f97c0180ceab565cc3f411e3dcc07bca8 (patch)
treea4a9273fc849990dd1e02f8fe3f097b2e68cea01 /src/main/java/com/amazon/carbonado/cursor
parentf1393c44e8e0f30da15a3443ebbf0c022c608fca (diff)
Added support for outer joins.
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.