Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
/**
* @author Subhashni Balakrishnan
* @author Michael Reiche
* @author Tigran Babloyan
*/
public class StringBasedN1qlQueryParser {
public static final String SPEL_PREFIX = "n1ql";
Expand Down Expand Up @@ -166,7 +167,7 @@ public StringBasedN1qlQueryParser(String statement, CouchbaseQueryMethod queryMe
this.queryMethod = queryMethod;
this.couchbaseConverter = couchbaseConverter;
this.statementContext = queryMethod == null ? null
: createN1qlSpelValues(collection != null ? collection : bucketName, scope, collection,
: createN1qlSpelValues(bucketName, scope, collection,
queryMethod.getEntityInformation().getJavaType(), typeField, typeValue, queryMethod.isCountQuery(), null, null);
this.parsedExpression = getExpression(statement, queryMethod, accessor, spelExpressionParser,
evaluationContextProvider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ void spelTests() throws Exception {

assertEquals("SELECT `_class`, `jsonNode`, `jsonObject`, `jsonArray`, META(`myCollection`).`cas`"
+ " AS __cas, `createdBy`, `createdDate`, `lastModifiedBy`, `lastModifiedDate`, META(`myCollection`).`id`"
+ " AS __id, `firstname`, `lastname`, `subtype` FROM `myCollection`|`_class` = \"abstractuser\"|`myCollection`|`myScope`|`myCollection`",
+ " AS __id, `firstname`, `lastname`, `subtype` FROM `myCollection`|`_class` = \"abstractuser\"|`some_bucket`|`myScope`|`myCollection`",
query.toN1qlSelectString(converter, bucketName(), "myScope", "myCollection", User.class, null, false, null,
null));
}
Expand Down