Commit Graph

660 Commits

Author SHA1 Message Date
Mark Paluch
9307c6ff97 Prepare 4.4 M3 (2021.2.0).
See #1307
2022-02-18 11:08:48 +01:00
Michael Reiche
25ecdbe6b1 Fix comment. (#1348)
Closes #1343.
2022-02-16 14:18:28 -08:00
Michael Reiche
83f55b1bda Allow CouchbaseCacheConfiguration to set collection. (#1344)
Closes #1343.
2022-02-16 09:32:14 -08:00
Michael Reiche
1fcd252b68 Translate CasMismatchException to OptimisticLockingFailureException. (#1341)
Translate CasMismatchException to OptimisticLockingFailureException
instead of DataIntegrityViolationException.  CasMismatchException is
a ConcurrencyFailureException which is a TransientDataAccessException.
Versus DataIntegrityViolation, which is a NonTransientDataAccessException.

Closed #1339.
2022-02-15 11:38:25 -08:00
Michael Reiche
fc075ccdeb 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-15 11:37:54 -08:00
Oliver Drotbohm
3a4459fa1c Adapt to changes in entity creation metadata APIs in Spring Data Commons. 2022-02-15 15:11:06 +01:00
Michael Reiche
ef56e3f3aa Add mechanism for save to do one of insert, replace or upsert. (#1316)
Closes #1277.
2022-02-14 09:10:04 -08:00
Michael Reiche
5c5dde3db1 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-14 09:09:09 -08:00
Michael Reiche
19c9e16717 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-11 08:22:04 -08:00
Michael Reiche
e20ebae10e Have tests remove the documents they insert. (#1336)
Closes #1335.
2022-02-09 21:56:22 -08:00
Michael Reiche
ede82d65ff Make FindByAnalytics count the same as FindByQuery. (#1334)
Closes #1331.
2022-02-09 21:07:09 -08:00
Michael Reiche
32f6a05462 Javadoc and other java 1_8 compatible changes in 50x back to main. (#1328)
Closes #1327.
2022-02-08 13:50:25 -08:00
Michael Reiche
c88a35c152 Fix slice support. (#1324)
Fix slice support. Also discontinue use of deprecated class.

Closes #1323.
2022-02-08 09:45:20 -08:00
Michael Reiche
895b2b270e Restore projection of class. (#1319)
Restore projection of class in queries. This is necessary for abstract repositories.

Closes #1315.
2022-02-03 06:19:32 -08:00
Michael Reiche
8f8efbd16f Fix CasMismatch documentation. (#1320)
Closes #1314.
2022-02-02 14:06:08 -08:00
Michael Reiche
f08b24ecf1 Expose template getScope(), getCollection() and potentiallyConvertRuntimeException. (#1317)
Closes #1310.
2022-02-01 13:43:14 -08:00
Michael Reiche
02bc0b35d3 Fix regression in IN operator. (#1309)
The regression occurred in changes for https://issues.couchbase.com/browse/MB-26606.

Closes #1308.
2022-01-25 10:11:35 -08:00
Christoph Strobl
7890f5e99f Prepare 4.4 M2 (2021.2.0).
See #1301
2022-01-18 09:09:02 +01:00
Michael Reiche
317d9b877c Allow caching null objects. (#1303)
Closes #939.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2022-01-17 14:17:53 -08:00
Michael Reiche
e15c6d0b4b Copy sort from pageable to query. (#1305)
Closes #1304.
2022-01-17 11:01:56 -08:00
Christoph Strobl
6b0e22a1f9 Prepare 4.4 M1 (2021.2.0).
See #1298
2022-01-14 10:57:51 +01:00
Michael Reiche
034881f9b0 Add Collections to Reference Documentation. (#1296)
Closes #1295.
2022-01-12 17:33:18 -08:00
Michael Reiche
3a216a83b4 Incorporate changes from 5.0.x and bump Couchbase SDK. (#1287)
Closes #1286.

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

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-11-12 07:15:45 -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
Michael Reiche
da3e8e0e36 Support N1QL Join Annotations. (#1211)
* Support N1QL Join Annotations.

Closes #1198.
2021-09-12 18:38:01 -07:00
Michael Reiche
4bd82ea23c Add project(fields) to findByQuery similar to same method on findById. (#1212)
Closes #1208, #1213.
2021-09-12 17:17:47 -07:00
Michael Reiche
edaf11ed85 Log warning message and rethrow exceptions from events. (#1207)
Closes #1206.
2021-08-26 15:09:34 -07:00
Michael Reiche
bcf11ce856 Support derived queries from methods named findDistinctF1AndF2ByF3() (#1202)
Support derived queries from methods named findDistinctF1AndF2ByF3().

Closes #1200.
2021-08-23 13:51:55 -07:00
Michael Reiche
f0880daf7a Fix ArrayIndexOutOfBoundsException on String queries that use paging. (#1197)
Closes #1155.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-08-23 13:06:57 -07:00
Michael Reiche
dffd203a57 Remove the sort from query before executing count. (#1194)
Also creates the query with skip and limit from any Pageable parameter instead of applying it later.
Closes #1191.
2021-08-18 09:07:15 -07:00
Michael Reiche
7e2963a365 Throw an explicit exception if count query does not return a count. (#1195)
Also just use the first projected property instead of one explicitly named "count".

Closes #925,#960.
2021-08-18 09:06:43 -07:00
Michael Reiche
6344b94825 Add target annotation to expiry annotation. (#1193)
It should have already had this as it was being used as an annotation
in AirportRepository.ComposedMetaAnnotation.
I believe a recent update to intellij now flags it as an error in the IDE.

Closes #1192.
2021-08-17 11:21:52 -07:00
Michael Reiche
07022c1e86 Remove unnecessary auditorAwareRef from test config. (#1189)
Remove unnecessary auditorAwareRef from test config as it causes
confusion. The property does not need to be preset for the auditorAwareRef
bean to be used.
The dateTimeProviderRef must be present for the provided
dateTimeProviderRef bean to be used.

Closes #1052.
2021-08-17 10:35:33 -07:00
Michael Reiche
f8b5ab205c Log exceptions thrown from events. (#1187)
Closes #1075.
2021-08-16 13:15:22 -07:00
Michael Reiche
5e92a99996 Fix links to snapshot and milestone in doc. (#1178)
The urls in the example are ok, but when the hot link in the
text is clicked on, it redirects to a 404. This fixes the hot links.

Closes #1177.
2021-08-16 13:04:13 -07:00
Michael Reiche
fada241988 N1ql query should project getFieldName() instead of getName(). (#1185)
Closes #1184.
2021-08-16 13:02:55 -07:00