diff --git a/src/main/java/org/springframework/data/couchbase/core/convert/join/N1qlJoinResolver.java b/src/main/java/org/springframework/data/couchbase/core/convert/join/N1qlJoinResolver.java index 4efd116b2..63c152a60 100644 --- a/src/main/java/org/springframework/data/couchbase/core/convert/join/N1qlJoinResolver.java +++ b/src/main/java/org/springframework/data/couchbase/core/convert/join/N1qlJoinResolver.java @@ -145,7 +145,7 @@ static KeySpacePair getKeySpacePair(String bucketName, String scope, String coll // Use the lhScope and lhCollection for the entity. The rhs is just the bucket. return new KeySpacePair(lhCollection, x(i(bucketName) + "." + i(lhScope) + "." + i(lhCollection)), // null, i(bucketName)); - } else if (lhCollection != null && rhCollection == null) { + } else if (lhCollection == null && rhCollection != null) { // the lhs does not have a collection (or scope), but rhs does have a collection // Using the same (default) scope for the rhs would mean specifying a // non-default collection in a default scope - which is not allowed.