Commit Graph

884 Commits

Author SHA1 Message Date
Mark Paluch
60f56cbc8e Updated changelog.
See #1100
2021-04-14 11:17:42 +02:00
Michael Reiche
19ef1dd7b6 Upgrade to Couchbase Java SDK 3.1.4. (#1123)
Upgrade to Couchbase Java SDK 3.1.4.

Closes #1122.
Original pull request #1123.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-04-13 06:30:26 -07:00
Jorge Rodríguez Martín
3f1cea174f Add support for reactive auditing and ReactiveEntityCallbacks.
Add support for reactive auditing and ReactiveEntityCallbacks.
Also, adapt CouchbaseAuditingRegistrar for support AuditingEntityCallback.

Closes #955.
Original pull request: #1102.

Co-authored-by: Carlos Espinado <carlosemart>
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-04-06 11:58:42 -04:00
Michael Reiche
5a04711a6d DefaultCouchbaseTypeMapper uses TypeAlias annotation if present.
DefaultCouchbaseTypeMapper uses TypeAlias annotation if present.
Test case also uncovered that TypeAlias was being ignored for
string queries.

Closes #1119.
Original pull request: #1120.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-04-06 08:13:50 -07:00
Michael Reiche
9b848f6254 Specific message for string queries that do not project __id and __cas.
com.couchbase.client.core.error.CouchbaseException: query did not project __id.
 Either use #{#n1ql.selectEntity} or project __id and __cas :
 SELECT __cas, * from `b406ab45-ef95-441f-a318-76b8e8af2d76` where iata = $1

Closes #1097.
Original pull request: #1114.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-04-06 08:03:02 -07:00
Mark Paluch
37587a1a0f Updated changelog.
See #1101
2021-03-31 18:30:46 +02:00
Mark Paluch
8a59d2bfda After release cleanups.
See #1086
2021-03-31 17:24:06 +02:00
Mark Paluch
df71894ec7 Prepare next development iteration.
See #1086
2021-03-31 17:24:04 +02:00
Mark Paluch
edfc8775db Release version 4.2 RC1 (2021.0.0).
See #1086
2021-03-31 17:05:09 +02:00
Mark Paluch
61dd699957 Prepare 4.2 RC1 (2021.0.0).
See #1086
2021-03-31 17:04:35 +02:00
Mark Paluch
c6945c95d4 Updated changelog.
See #1086
2021-03-31 17:04:32 +02:00
Michael Reiche
2e8d655751 Fix N1QLExpression keys.
Fix syntax of N1QLExpression keys.

Closes #1064.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-03-31 06:10:42 -07:00
Michael Reiche
d16bbff4fe Support enum arguments on repository queries.
Support enum in AbstractCouchbaseConverter.convertForWriteIfNeeded()
and also call that from
MappingCouchbaseConverter.getPotentiallyConvertedSimpleWrite()

Closes #1069.
Original pull request: #1112.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-03-30 17:32:22 -04:00
Michael Reiche
fe8d3feb48 Add QueryCriteria arrayContaining.
Add QueryCriteria arrayContaining which maps to n1ql array_containing.

Closes #1073.
Original pull request: #1109.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-03-30 17:32:22 -04:00
Michael Reiche
4c428c5351 Use queryScanConsistency on reactive deleteAll().
It was present on non-Reactive, but missing from reactive.

Closes #1096.
Original pull request: #1108.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-03-30 17:32:22 -04:00
Michael Reiche
08c7a5c7b4 Update versions to correct values.
Closes #1105.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-03-30 17:32:22 -04:00
Yanming Zhou
57aa3ff70e Fix indent.
Closes 1116.
2021-03-30 17:29:39 -04:00
Mark Paluch
7cb1da0c1c After release cleanups.
See #1099
2021-03-17 11:30:31 +01:00
Mark Paluch
4da304a501 Prepare next development iteration.
See #1099
2021-03-17 11:30:29 +01:00
Mark Paluch
2983abc372 Release version 4.2 M5 (2021.0.0).
See #1099
2021-03-17 11:17:50 +01:00
Mark Paluch
ce868957f8 Prepare 4.2 M5 (2021.0.0).
See #1099
2021-03-17 11:17:27 +01:00
Mark Paluch
85e42974b3 Updated changelog.
See #1099
2021-03-17 11:17:24 +01:00
Mark Paluch
f36a1325a2 Updated changelog.
See #1091
2021-03-17 11:03:40 +01:00
Mark Paluch
2b6bd59d6a Updated changelog.
See #1084
2021-03-17 10:35:14 +01:00
Michael Reiche
cbcd048f3d Upgrade Couchbase Java SDK to 3.1.3. (#1098)
Closes #1079.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-03-15 12:12:06 -07:00
Michael Reiche
a142f0895a Revert changes to public apis that were altered instead of just deprecated. (#1093)
Closes #1092.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-03-05 17:01:58 -08:00
Christoph Strobl
03c96d96e1 After release cleanups.
See #1090
2021-02-18 11:35:22 +01:00
Christoph Strobl
aaaafe12f9 Prepare next development iteration.
See #1090
2021-02-18 11:35:21 +01:00
Christoph Strobl
8fd81e0c62 Release version 4.2 M4 (2021.0.0).
See #1090
2021-02-18 11:25:13 +01:00
Christoph Strobl
7b2e2472a8 Prepare 4.2 M4 (2021.0.0).
See #1090
2021-02-18 11:24:46 +01:00
Christoph Strobl
1e897cb03a Updated changelog.
See #1090
2021-02-18 11:24:46 +01:00
Christoph Strobl
5b656b2a32 Updated changelog.
See #1085
2021-02-18 11:18:29 +01:00
mikereiche
ed31a8dbaf Complete revert of DATACOUCH-550.
The previous "Revert" only reverted CouchbaseTemplate resulting in compilation errors in master.

Closes #858
2021-02-18 08:50:45 +01:00
Michael Reiche
8c6598271a Revert "DATACOUCH-550 - Refactored the usage of CouchbasePersistentEntityIndexCreator. (#298)" (#1087)
This reverts commit 80bae4bf67.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-02-17 09:19:06 -08:00
Christoph Strobl
79e82c22eb After release cleanups.
See #1044
2021-02-17 14:17:49 +01:00
Christoph Strobl
b53849d818 Prepare next development iteration.
See #1044
2021-02-17 14:17:48 +01:00
Christoph Strobl
c2962b07ba Release version 4.2 M3 (2021.0.0).
See #1044
2021-02-17 14:00:09 +01:00
Christoph Strobl
432863c2ab Prepare 4.2 M3 (2021.0.0).
See #1044
2021-02-17 13:59:43 +01:00
Christoph Strobl
d39652703b Updated changelog.
See #1044
2021-02-17 13:59:40 +01:00
Christoph Strobl
7e80dee20a Updated changelog.
See #1043
2021-02-17 13:49:20 +01:00
Christoph Strobl
46900975b5 Updated changelog.
See #976
2021-02-17 11:34:26 +01:00
Christoph Strobl
30b5edbdd5 Updated changelog.
See #975
2021-02-17 10:58:26 +01:00
Michael Reiche
41ee1f99ee DATACOUCH-1066 - Make QueryCriteria key a N1qlExpression. (#1082)
This is a merge of mmonti's changeset into master. The changeset was made
on top of 4.1.x instead of master so it has a little catching up to do.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-02-16 18:08:06 -08:00
dependabot[bot]
9356e43008 Bump hibernate-validator from 5.2.4.Final to 5.3.6.Final (#254)
Bumps [hibernate-validator](https://github.com/hibernate/hibernate-validator) from 5.2.4.Final to 5.3.6.Final.
- [Release notes](https://github.com/hibernate/hibernate-validator/releases)
- [Changelog](https://github.com/hibernate/hibernate-validator/blob/5.3.6.Final/changelog.txt)
- [Commits](https://github.com/hibernate/hibernate-validator/compare/5.2.4.Final...5.3.6.Final)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-16 16:03:15 -08:00
Michael Reiche
6ab350df35 DATACOUCH-1041 - Add withCas() method to RemoveById. (#1051)
Add withCas() method to RemoveById.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-02-16 15:16:12 -08:00
Jorge Rodríguez Martín
1329cae703 DATACOUCH-652 - Inject translation service bean in CouchbaseTemplateSupport. (#294) 2021-01-15 10:29:14 -08:00
Michael Reiche
ad5551625d DATACOUCH-958 - Restore auditorAwareRef and dateTimeProviderRef to empty. (#1050)
Restore auditorAwareRef and dateTimeProviderRef to empty. To us them, they will need to be specified in
@EnableCouchbaseAuditing( auditorAwareRef="auditorAwareRef", dateTimeProviderRef="dateTimeProviderRef")

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-01-14 16:07:04 -08:00
Aaron Whiteside
80bae4bf67 DATACOUCH-550 - Refactored the usage of CouchbasePersistentEntityIndexCreator. (#298)
pom.xml
- updated CouchbaseMock dependency to the official release on maven central, which now includes the required commit.

CouchbaseTemplate.java
- remove creation of CouchbasePersistentEntityIndexCreator
- there can only be a single CouchbaseMappingContext and CouchbasePersistentEntityIndexCreator, not sure why there was code dealing with multiples of each, and there was no corresponding tests for these assumptions.
- no longer does the job of a @Configuation class by gluing beans together with their dependencies.

CouchbaseMappingContext.java
- removed references to auto index creation, that functionality should be a completely separate concern.

CouchbasePersistentEntityIndexCreator.java
- as well as implementing ApplicationListener, it now also implements InitializingBean
- when afterPropertiesSet() is called it uses CouchbaseMappingContext#getPersistentEntities to retrieve the list of entity candidates for index creation. This will handle the creation of indices for entities known at @Configuration time.
- for entities not in the initialEntitySet of the MappingContext, the ApplicationListener will handle those entities at runtime.
- this is needed because the AbstractMappingContext will emit events when it is initialized via InitializingBean, and any beans that depend on MappingContext and also implement ApplicationListener expecting to receive those events won't.
 - in our case because Spring will have fully initialised the CouchbaseMappingContext instance before passing it to the CouchbasePersistentEntityIndexCreator instance we won't get those events.
- added a boolean flag to indicate if automatic index creation is to be enabled or now, passed in by the factory method that creates this bean.
- minor logging cleanup, use property placeholders where appropriate

AbstractCouchbaseConfiguration.java
- added a new factory method for the CouchbasePersistentEntityIndexCreator bean.
- CouchbaseMappingContext no longer has anything to do with index creation, other than supplying a candidate list of entities that may need indices.

Prompted by:
https://github.com/spring-projects/spring-boot/issues/24525
and the discussion on https://github.com/spring-projects/spring-data-couchbase/pull/295

Co-authored-by: Aaron Whiteside <awhiteside@yapstone.com>
2021-01-14 11:42:44 -08:00
Michael Reiche
59bf9d7457 DATACOUCH-1048 - Update copyright in two new classes. (#1049)
Update copyright in two new classes.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-01-14 11:22:15 -08:00
Michael Reiche
0e8d5a255a DATACOUCH-588 - Part 2 of framework changes. Add support for projection and distinct. (#1040)
Support for projection is only for properties of the top-level entity. For instance, in UserSubmission, only the properties below can be specified in the projection. Projection support does not provide means of specifying something like address.street - you can only project (or not project) the whole address property. However, the address type in your resultType could have a subset of the properties in Address.

If the corresponding submissions in the resultType contained only the userId property

public class UserSubmission extends ComparableEntity {
	private String id;
	private String username;
	private List<String> roles;
	private Address address;
	private List<Submission> submissions;

Support for Distinct - I have appropriated the MongoDB model for Distinct.  It defines a separate DistinctOperationSupport class (within ExecutableFindByQuerySupport) which supports the distinct( distinctFields ) api and execution. The DistinctOperationSupport class has only a distinctFields member, and a 'delegate' member, which is an ExecutableFindByQuerySupport object. TBH, I don't see the advantage over simply adding a distinctFields member to ExecutableFindByQuerySupport

Amend #1 - changes as discussed in Pull Request
         - clean up test entity types

Amend #2
- Eliminate DistinctOperationSupport class. In MongoDB, only distinct on a single field is supported, so the returnType from distinct was very different from the returnType of other query operations (all(), one() etc. (but so is count(), and it doesn't need it's own class)). In Couchbase, distinct on any fields in the entity is allowed - so the returned type could be the domainType or resultType. And as(resultType) still allows any resultType to be specified. This makes it unnecessary to have combinations of interfaces such as DistinctWithProjection and DistinctWithQuery.

- Clean up the interfaces in ExecutableFindByQuery. There are two types of interfaces (a) the TerminatingFindByQuery which has the one(), oneValue() first(), firstValue(), all(), count(), exists() and stream(); and (b) the option interfaces (FindByQueryWithConsistency etc), which are essentially with-er interfaces. The changes are:
1) make all the with-er interfaces base interfaces instead of chaining them together. (I don't know why there isn't simply one interface with all the with-er methods).
2) make the ExecutableFindByQuery interface extend the Terminating interface and all the with-er interfaces.

Amend #3
- Add execution support for collections

Amend #4
- Add tests for collections. This includes a new CollectionAwareIntegrationTests class which extends a new JavaIntegratationTests class which extends the existing ClusterAwareIntegrationTests.
- Fixed up several issues collections issues that were uncovered by the tests.
- Did further cleanup of OperationSupport interfaces.

Amend #5
- Revert changes to interfaces in *Operation
- Sorted interfaces in same order for consistency (because of the chaining of interfaces, fluent methods must be called in order).

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-01-14 11:03:20 -08:00