592 Commits

Author SHA1 Message Date
Michael Reiche
4f2983bbf9 Move tests needing server to IntegrationTests.
Closes #1472.
2022-06-23 15:30:04 -07:00
Jens Schauder
c331b6f5c3 Prepare 4.1.15 (2020.0.15).
See #1254
2021-11-12 09:36:36 +01:00
Mark Paluch
73ba7e97c6 Prepare 4.1.14 (2020.0.14).
See #1234
2021-10-18 10:53:24 +02:00
Mark Paluch
45a6bf55b2 Prepare 4.1.13 (2020.0.13).
See #1181
2021-09-17 08:53:11 +02:00
Jens Schauder
587ac27266 Prepare 4.1.12 (2020.0.12).
See #1160
2021-08-12 10:25:34 +02:00
Jens Schauder
8b072c07ee Prepare 4.1.11 (2020.0.11).
See #1152
2021-07-16 10:18:58 +02:00
Jens Schauder
d8a11f18f0 Updated changelog.
See #1152
2021-07-16 10:18:55 +02:00
Mark Paluch
465cd58b8c Updated changelog.
See #1139
2021-06-22 16:07:30 +02:00
Mark Paluch
9f83c9a962 Prepare 4.1.10 (2020.0.10).
See #1138
2021-06-22 15:17:56 +02:00
Mark Paluch
cdb1284216 Updated changelog.
See #1138
2021-06-22 15:17:52 +02:00
Mark Paluch
434951c3ec Updated changelog.
See #1127
2021-05-14 12:36:42 +02:00
Mark Paluch
05679c428a Prepare 4.1.9 (2020.0.9).
See #1126
2021-05-14 11:51:55 +02:00
Mark Paluch
6c78f725cb Updated changelog.
See #1126
2021-05-14 11:51:50 +02:00
Mark Paluch
7e824bae95 Updated changelog.
See #1117
2021-04-14 14:40:04 +02:00
Mark Paluch
16c3e70803 Prepare 4.1.8 (2020.0.8).
See #1118
2021-04-14 11:32:49 +02:00
Mark Paluch
2b0946bca0 Updated changelog.
See #1118
2021-04-14 11:32:45 +02:00
Mark Paluch
c4762077cf Updated changelog.
See #1100
2021-04-14 11:17:43 +02:00
Mark Paluch
1f92343f89 Prepare 4.1.7 (2020.0.7).
See #1101
2021-03-31 18:19:21 +02:00
Mark Paluch
535d2e49ee Updated changelog.
See #1101
2021-03-31 18:19:17 +02:00
Mark Paluch
fe989f507e Updated changelog.
See #1086
2021-03-31 17:26:09 +02:00
Mark Paluch
6cf172600e Updated changelog.
See #1099
2021-03-17 11:31:33 +01:00
Mark Paluch
adc45a22da Prepare 4.1.6 (2020.0.6).
See #1091
2021-03-17 10:53:44 +01:00
Mark Paluch
095ff39506 Updated changelog.
See #1091
2021-03-17 10:53:42 +01:00
Mark Paluch
d5e3833664 Updated changelog.
See #1084
2021-03-17 10:35:16 +01:00
mikereiche
b2c1f7a72f Upgrade Couchbase Java SDK to 3.1.3.
Closes #1079.
Original pull request #1098.
2021-03-15 15:52:55 -04:00
Michael Reiche
fdbb839119 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-15 15:41:35 -04:00
Christoph Strobl
dd047e29cc Updated changelog.
See #1090
2021-02-18 11:37:50 +01:00
Christoph Strobl
bd4bdcfacc Prepare 4.1.5 (2020.0.5).
See #1085
2021-02-18 10:58:50 +01:00
Christoph Strobl
37f6048e15 Updated changelog.
See #1085
2021-02-18 10:58:49 +01:00
Michael Reiche
029f30aed9 Revert "DATACOUCH-550 - Refactored the usage of CouchbasePersistentEntityIndexCreator. (#298)" (#1088)
This reverts commit 883c931cf4.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-02-17 09:53:29 -08:00
Christoph Strobl
eab08442f8 Updated changelog.
See #1044
2021-02-17 14:20:37 +01:00
Christoph Strobl
a85952c57d Prepare 4.1.4 (2020.0.4).
See #1043
2021-02-17 11:59:37 +01:00
Christoph Strobl
290bccb08f Updated changelog.
See #1043
2021-02-17 11:59:36 +01:00
Christoph Strobl
8875c9f539 Updated changelog.
See #976
2021-02-17 11:34:28 +01:00
Christoph Strobl
f11f9e2d9a Updated changelog.
See #975
2021-02-17 10:58:28 +01:00
Michael Reiche
8fa7cb1149 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.

Original pull request #1082

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-02-16 18:17:56 -08:00
Jorge Rodríguez Martín
c2741d8045 DATACOUCH-652 - Inject translation service bean in CouchbaseTemplateSupport. (#294) 2021-02-16 15:11:36 -08:00
Michael Reiche
c34cad0562 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-02-16 15:09:28 -08:00
Aaron Whiteside
883c931cf4 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-02-16 15:06:11 -08:00
Michael Reiche
e9a99cf5e4 DATACOUCH-1048 - Update copyright in two new classes. (#1049)
Update copyright in two new classes.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-02-16 15:03:33 -08:00
Michael Reiche
37113c67ad DATACOUCH-588 - Part 2 of 2 refactoring for paging and projection. (#1080)
* 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>

* DATACOUCH-588 - after cherry-pick, remove reference to 4.2 method deleteAllById().

Original pull request #1040
2021-02-16 15:01:21 -08:00
Michael Reiche
570792d353 DATACOUCH-588 - Refactoring part 1 of n. (#278)
* DATACOUCH-588 - Implement pageable and realign repo query

This implements pageable for non-reactive queries and
realigns reactive queries with other spring-data projects
to facilitate the implementaion of pageable (done) and other
types of queries such as projection and distinct (not yet
done)

* DATACOUCH-588 - Implement pageable and realign repo query

This implements pageable for non-reactive queries and
realigns reactive queries with other spring-data projects
to facilitate the implementaion of pageable (done) and other
types of queries such as projection and distinct (not yet
done)

* DATACOUCH-588 - Refactoring part 1 of n.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-02-16 14:21:40 -08:00
Michael Reiche
f65bd6a9d1 DATACOUCH-645 - Support document expiryExpression. (#296)
Support document expiryExpression and make the initial expiry
to be null instead of Zero in the fluent API. This allows
a client to 'unset' the expiry from an annotation by explcitly
setting withExpiry(Zero).

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-02-16 13:41:20 -08:00
Michael Reiche
25e025b4fe DATACOUCH-550 - Autoindexing does not work spring-boot application. (#297)
Due to the interdependencies of beans, autoindexing does not work
in the startup of a normal spring-boot application. Processing of
entities occurs during the initialization of CouchbaseMappinContext,
which occurs before initialization of MappingCouchbaseConverter,
which occurs before the initialization of CouchbaseTemplate -
which creates the indexCreator listener. So when the
AbstractMappingContext (CouchbaseMappingContext) is publishing
MappingContextEvents - there is not yet any indexCreator.
And subsequent processing of entities finds the entities cached,
and therefore does not publish MappingContextEvents. This change
overrides the addPersistentEntity() and getPersistentEntity()
methods of AbstractMappingContext such that caching does not
preven the MappingContextEvents from being published.  This change
also exposes indexCreator classesSeen map to CouchbaseMappingContext
so that once an entity has been processed by indexCreator, it is
not published again.

Autoindexing by SpringJUnitConfig did work prior to this change.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-02-16 13:21:16 -08:00
Michael Reiche
86281fbe60 DATACOUCH-675 - Factor out interfaces for common methods. (#293)
Added interfaces for apis on core objects which are common among
many objects. For instance withExpiry and withExpirty on all the
insert/replace/upsert/remove objects.  The definition of an interface
simplyfies testing of all the possible combinations - instead of having
four (or eight, counting Reactive), there is one interface to test
them all.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-02-16 12:36:17 -08:00
Michael Reiche
aaf907399c DATACOUCH-526 - N1qlJoinResolver not escaping bucketNames with special characters (#291)
It escape the first bucket name, but not the second one.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-02-16 12:34:14 -08:00
Michael Reiche
716e81a95a DATACOUCH-653 - Update example versions in documentation. (#280)
The format has changed as well. The release versions no longer have
the .RELEASE suffix - they are just the version number (i.e. 4.1.1)
And the snapshot versions have the suffix -SNAPSHOT (i.e. 4.2.0-SNAPSHOT)
instead of 4.1.0.BUILD-SNAPSHOT

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-02-16 11:51:25 -08:00
Christoph Strobl
01880de702 Updated changelog.
See #978
2021-01-13 15:49:52 +01:00
Christoph Strobl
d2a6ced9ce Prepare 4.1.3 (2020.0.3).
See #979
2021-01-13 14:56:53 +01:00
Christoph Strobl
f78829322b Updated changelog.
See #979
2021-01-13 14:55:36 +01:00