Commit Graph

672 Commits

Author SHA1 Message Date
Michael Reiche
4d83de278e Fix test compilation issue introduced by bad automerge in cherry-pick. (#1432)
Closes #1431.
2022-05-11 11:06:11 -07:00
Michael Reiche
4b18a6f983 Only project id and cas if required. (#1404)
Closes #1402.
2022-05-11 10:36:24 -07:00
Michael Reiche
db41f22d46 Fix Collection Support for Cache for non-Collection Server. (#1418)
Also fix test setup index flakiness on older servers.

Closes #1417.
2022-05-11 10:35:58 -07:00
Michael Reiche
5b74604a86 Only throw exception for id and cas not projected if needed. (#1395)
Closes #1394.
2022-05-11 10:35:42 -07:00
Michael Reiche
ee0a0a6ba5 Proper handling of metadata from CrudMethodMetadataPostProcessor. (#1393)
Retrieve the data before any reactive lambda.
When the method returns, in can immediately be removed from
the currentInvocation, and the previous data restored.

Closes #1392.
2022-05-11 10:35:08 -07:00
Michael Reiche
59e65303a1 Check for _ID and _CAS as well as __id and __cas being projected from query and analytics. (#1390)
Closes #1389.
2022-05-11 10:34:40 -07:00
Michael Reiche
40faef3c77 Support testing against Capella. (#1386)
Support testing against Capella. Also includes sample to
use Capella control-plane.

Closes #1385.
2022-05-10 14:39:17 -07:00
Michael Reiche
03cacc384f Check for _ID and _CAS as well as __id and __cas being projected from query and analytics. (#1390)
Closes #1389.
2022-05-10 12:26:32 -07:00
Michael Reiche
84da071b76 Bump 4.3.x Couchbase Java SDK to 3.2.6. (#1411)
Also put quotes around bucket name in CollectionAwareIntegrationTests setup.

Closes #1409.
2022-04-19 16:06:28 -07:00
Christoph Strobl
2e121b4575 Prepare 4.3.4 (2021.1.4).
See #1376
2022-04-19 12:02:46 +02:00
Mark Paluch
b3f9e82519 Prepare 4.3.3 (2021.1.3).
See #1350
2022-03-21 14:58:28 +01:00
Michael Reiche
d7864294cd Fix cache to use collections part 2. (#1373)
Closes #1369.
2022-03-15 20:55:12 -07:00
Michael Reiche
0ff7558ea1 Fix cache.clear() to use collection. (#1371)
Closes #1369.

Co-authored-by: Michael Reiche <michael.reiche@couchbase.com>
2022-03-15 20:54:15 -07:00
Michael Reiche
85738b585e Support derived queries on repositories defined with an abstract entity class. (#1366)
Motivation:
Currently an abstract entity class specified in the repository definition can
be used for the predicate typeKey = typeAlias(of abstract entity class) in
queries. Since documents are stored with typeKey = typeAlias(of concrete class)
those queries will never match any documents.  To allow this to work,
all of the abstract entity class an all concrete subclasses must use the
same typeAlias.

Once those documents are found, regardless of their concrete class,
they will all have the same typeKey = typeAlias, instead of having the
typeAlias specific to the concrete class. Additional information in
the stored document is needed to identify the concrete class (subtype
in the example test case), as well as a TypeMapper to interpret that
 information.

Changes:
This allows a common TypeAlias to be used for the purpose of the predicate
typeKey = typeAlias, and the determination of the concrete type by
implementing an AbstractingMappingCouchbaseConverter that inspects the
'subtype' property.

Closes #1365.

Co-authored-by: Michael Reiche <michael.reiche@couchbase.com>
2022-03-14 11:52:42 -07:00
Michael Reiche
f89496c940 Fix update to cache documentation. (#1359)
Closes #1358.
2022-03-14 11:52:23 -07:00
Michael Reiche
a8df28c000 Reinstate CouchbaseCache documentation. (#1357)
Closes #1356.
2022-03-14 11:51:44 -07:00
Mark Paluch
fc7af1c3b0 Prepare 4.3.2 (2021.1.2).
See #1300
2022-02-18 10:40:40 +01:00
Michael Reiche
47b1d6af98 Fix comment. (#1348)
Closes #1343.
2022-02-16 14:34:17 -08:00
Michael Reiche
84dafa7b07 Allow CouchbaseCacheConfiguration to set collection. (#1344)
Closes #1343.
2022-02-16 12:59:20 -08:00
Michael Reiche
cdf02cb5de Add collections support to N1qlJoin. (#1333)
The scope for the entity can come from an option, a method annotation,
an annotation on the repository or an annotation on the entity class.
All these possibilities are handle by PseudoArgs in the
OperationSupport implementation. That scope/collection are passed
into decodeEntity(). The scope/collection of the child can only come
from an annotation on the entity class. The scope/collection of the
parent and child are uses as follows:

1) Both the parent and the chold have non-default collections
It's possible that the scope for the parent was set with an annotation on
a repository method, the entity class or the repository class or a query
option. Since there is no means to set the scope of the child class by the
method, repository class or query option (only the annotation) we assume
that the (possibly) dynamic scope of the entity would be a better choice
as it is logical to put collections to be joined in the same scope.

2) The parent has a collection (and therefore a scope as well), but the
child  does not have a collection. Use the lhScope and lhCollection for
the entity.  The child is just the bucket.

3) The parent does not have a collection (or scope), but child does have a
collection. Using the same (default) scope for the child would mean
specifying a non-default collection in a default scope - which is not
allowed. So use the scope and collection from the child class.

4) Neither have collections, just use the bucket.

Closes #1325.
2022-02-16 12:58:15 -08:00
Michael Reiche
88e23b5005 Add mechanism for save to do one of insert, replace or upsert. (#1316)
Closes #1277.
2022-02-16 12:56:18 -08:00
Michael Reiche
6ebb0dd20e Collection support for predicates on meta fields. (#1338)
When a derived query is being created and there is a predicate on
a meta-field ( meta().id, cas, expiry), translate that field
(i.e. id -> meta().id) *without* the bucket or collection name,
as it might apply to a collelction which we do not know yet
(for instance, if there is a withCollection() specified)..
This is fine, because in a derived query, meta() without the
bucket or collection name is unambigous.
2022-02-16 12:56:00 -08:00
Michael Reiche
9048c7ca82 Make withDurability() return WithScope type for all operations. (#1340)
Some of the operations were mistakenly declared to return a
WithCollection type, making it impossible to call the inScope()
method.

Closes #1329.
2022-02-16 12:55:38 -08:00
Michael Reiche
d4f37c4598 Have tests remove the documents they insert. (#1336)
Closes #1335.
2022-02-16 12:38:32 -08:00
Michael Reiche
6759dfa430 Make FindByAnalytics count the same as FindByQuery. (#1334)
Closes #1331.
2022-02-16 12:37:27 -08:00
Michael Reiche
745929cc82 Fix slice support. (#1324)
Fix slice support. Also discontinue use of deprecated class.

Closes #1323.
2022-02-08 09:53:39 -08:00
Michael Reiche
642be863c3 Restore projection of class. (#1319)
Restore projection of class in queries. This is necessary for abstract repositories.

Closes #1315.
2022-02-04 09:10:01 -08:00
Michael Reiche
26636d4497 Fix CasMismatch documentation. (#1320)
Closes #1314.
2022-02-04 09:09:30 -08:00
Michael Reiche
3844396ae6 Expose template getScope(), getCollection() and potentiallyConvertRuntimeException. (#1317)
Closes #1310.
2022-02-04 09:06:34 -08:00
Michael Reiche
fd10989bee Fix regression in IN operator. (#1309)
The regression occurred in changes for https://issues.couchbase.com/browse/MB-26606.

Closes #1308.
2022-02-04 09:03:19 -08:00
Michael Reiche
c6e1138123 Allow caching null objects. (#1303)
Closes #939.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2022-02-04 08:59:26 -08:00
Michael Reiche
daa35059de Copy sort from pageable to query. (#1305)
Closes #1304.
2022-02-04 08:53:22 -08:00
Christoph Strobl
f6f7f73741 Prepare 4.3.1 (2021.1.1).
See #1268
2022-01-14 10:28:27 +01:00
Michael Reiche
c3aa7b915a Add Collections to Reference Documentation. (#1296)
Closes #1295.
2022-01-12 17:36:10 -08:00
Michael Reiche
16edeefa6f Incorporate changes from 5.0.x and bump Couchbase SDK. (#1287)
Closes #1286.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2022-01-12 12:08:15 -08:00
Michael Reiche
721e9d7338 Handle Collection<> parameters to repository query methods. (#1271)
Closes #1270.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2022-01-12 11:46:36 -08:00
Jens Schauder
0a73828b17 Prepare 4.3 GA (2021.1.0).
See #1257
2021-11-12 10:49:16 +01:00
yyfMichaelYan
d8d249502d fix flaky test writesAndReadsCustomFieldsConvertedClass (#1264) 2021-11-08 11:40:01 -08:00
Michael Reiche
9f2d7ee6b5 Field named id treated as document id. (#1261)
Closes #1258.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-10-26 10:52:50 -07:00
Michael Reiche
e1b0ea98d9 Reinstate the getDefaultConsistency() method in the Configuration. (#1249)
Closes #1243.
2021-10-22 11:42:55 -07:00
Mark Paluch
17e6d8525f Prepare 4.3 RC1 (2021.1.0).
See #1236
2021-10-18 13:47:48 +02:00
Michael Reiche
37648c80d0 Unbean couchbaseObjectMapper(). (#1240)
Closes #1209.
2021-09-23 09:20:04 -07:00
Mark Paluch
0d3fb83030 Prepare 4.3 M3 (2021.1.0).
See #1183
2021-09-17 09:44:35 +02:00
Michael Reiche
a472e2a1a5 Expose TemplateSupport from Template. (#1233)
Closes #1210.
2021-09-16 12:05:50 -07:00
Michael Reiche
66cc1b5491 Changes for PR 1223 that I had missed. (#1230)
Closes #1229.
2021-09-14 16:38:11 -07:00
Michael Reiche
b9fa1c76ab Fix test failure against mocked. (#1227)
Closes #1226.
2021-09-14 11:10:16 -07:00
Michael Reiche
1e774d460b Test case for exceptions thrown from events - validation. (#1225)
Closes #1224.
2021-09-14 10:09:51 -07:00
Michael Reiche
a879d0b4e3 Use expiry(duration) with duration. (#1223)
Also adds test for exceptions thrown during events - with validator.

Closes #1204.
2021-09-14 09:49:12 -07:00
Michael Reiche
7c1167f302 Specifying withExpiry(Duration) on findById() uses getTouchAndRead(). (#1196)
Closes #982.
2021-09-13 11:21:23 -07:00
Michael Reiche
345af53930 Pass source as parent when reading subobject. (#1222)
Closes #1221.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-09-13 11:11:05 -07:00