Skip to content

Commit 9d455a8

Browse files
committed
Merge branch 'master' of github.com:spring-projects/spring-data-couchbase into datacouch_1097_specific_message_for_string_queries_that_dont_project_cas_id
2 parents 7854edd + 37587a1 commit 9d455a8

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed

src/main/java/org/springframework/data/couchbase/core/query/N1QLExpression.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,13 +262,14 @@ public N1QLExpression returning(N1QLExpression right) {
262262
public N1QLExpression keys(Iterable<? extends Serializable> ids) {
263263
StringBuilder sb = new StringBuilder();
264264
Iterator<?> it = ids.iterator();
265-
// TODO: really? Lets do better.
265+
sb.append("[");
266266
while (it.hasNext()) {
267-
sb.append(i(it.next().toString()));
267+
sb.append(s(it.next().toString()));
268268
if (it.hasNext()) {
269269
sb.append(",");
270270
}
271271
}
272+
sb.append("]");
272273
return infix("USE KEYS", toString(), sb.toString());
273274
}
274275

src/main/resources/changelog.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
Spring Data Couchbase Changelog
22
===============================
33

4+
Changes in version 4.1.7 (2021-03-31)
5+
-------------------------------------
6+
* #1103 - revert 4.1.x to sdk 3.0.x.
7+
8+
9+
Changes in version 4.2.0-RC1 (2021-03-31)
10+
-----------------------------------------
11+
* #1105 - Readme lists artifacts with .RELEASE and .BUILD-SNAPSHOT suffixes.
12+
* #1096 - SimpleReactiveCouchbaseRepository.deleteAll() missing scan consistency.
13+
* #1073 - Support for ARRAY_CONTAINS.
14+
* #1069 - Enums can't be used as method parameters in Repository.
15+
* #1064 - N1QLExpression#keys is broken.
16+
17+
418
Changes in version 4.2.0-M5 (2021-03-17)
519
----------------------------------------
620
* #1092 - regression - changes to public API CouchbaseRepositoryQuery and ReactiveCouchbaseRepositoryQuery.
@@ -1367,6 +1381,8 @@ Release Notes - Spring Data Couchbase - Version 1.0 M1 - 2013-09-11
13671381

13681382

13691383

1384+
1385+
13701386

13711387

13721388

src/main/resources/notice.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Spring Data Couchbase 4.2 M5 (2021.0.0)
1+
Spring Data Couchbase 4.2 RC1 (2021.0.0)
22
Copyright (c) [2013-2019] Couchbase / Pivotal Software, Inc.
33

44
This product is licensed to you under the Apache License, Version 2.0 (the "License").
@@ -25,3 +25,4 @@ conditions of the subcomponent's license, as noted in the LICENSE file.
2525

2626

2727

28+

src/test/java/org/springframework/data/couchbase/core/query/QueryCriteriaTests.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
import com.couchbase.client.java.json.JsonArray;
3030

31+
import java.util.Arrays;
32+
3133
/**
3234
* @author Mauro Monti
3335
*/
@@ -251,6 +253,15 @@ void testFalse() {
251253
assertEquals("not( (`name`) )", c.export());
252254
}
253255

256+
@Test
257+
void testKeys() {
258+
N1QLExpression expression = N1QLExpression.x("");
259+
assertEquals(" USE KEYS [\"a\",\"b\"]", expression.keys(Arrays.asList("a", "b")).toString());
260+
assertEquals(" USE KEYS [\"a\"]", expression.keys(Arrays.asList("a")).toString());
261+
assertEquals(" USE KEYS []", expression.keys(Arrays.asList()).toString());
262+
}
263+
264+
254265
@Test // https://github.com/spring-projects/spring-data-couchbase/issues/1066
255266
void testCriteriaCorrectlyEscapedWhenUsingMetaOnLHS() {
256267
final String bucketName = "sample-bucket";

0 commit comments

Comments
 (0)