Commit Graph

860 Commits

Author SHA1 Message Date
Christoph Strobl
dd047e29cc Updated changelog.
See #1090
2021-02-18 11:37:50 +01:00
Christoph Strobl
7d7f194f3f After release cleanups.
See #1085
2021-02-18 11:12:46 +01:00
Christoph Strobl
d6f83b42b5 Prepare next development iteration.
See #1085
2021-02-18 11:12:45 +01:00
Christoph Strobl
d1291f3b6b Release version 4.1.5 (2020.0.5).
See #1085
2021-02-18 10:59:16 +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
0fd3b492bf After release cleanups.
See #1043
2021-02-17 13:41:55 +01:00
Christoph Strobl
2d9f0b9474 Prepare next development iteration.
See #1043
2021-02-17 13:41:54 +01:00
Christoph Strobl
07d9fe21ae Release version 4.1.4 (2020.0.4).
See #1043
2021-02-17 12:00:24 +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
d2be5d17b4 After release cleanups.
See #979
2021-01-13 15:01:50 +01:00
Christoph Strobl
4da3b9b664 Prepare next development iteration.
See #979
2021-01-13 15:01:49 +01:00
Christoph Strobl
5a55a79b11 Release version 4.1.3 (2020.0.3).
See #979
2021-01-13 14:56:53 +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
Mark Paluch
06500e1eaa Revert commits for DATACOUCH-650 that shouldn't had been backported to 4.1.x.
See #1042
2021-01-13 14:52:43 +01:00
Greg L. Turnquist
899156269d DATACOUCH-664 - Use Docker hub credentials for all CI jobs. 2020-12-17 11:18:08 -06:00
Michael Reiche
aa52337d13 DATACOUCH-666 - Set Ccouchbase java sdk back to 3.0.10 after inadvertenly changing. (#290) 2020-12-09 14:19:38 -08:00
Michael Reiche
0d110de7b5 DATACOUCH-661 - Fix integrations tests from 650. (#281)
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2020-12-09 14:04:25 -08:00
Mark Paluch
57c21a7e62 DATACOUCH-650 - Polishing.
Reorder methods. Remove superfluous final keyword. Reformat pom. Fix dependency to Spring Data Commons.

Original pull request: #279.
2020-12-09 14:03:50 -08:00
Jens Schauder
dfd2dd66b3 DATACOUCH-650 - Implements CrudRepository and ReactiveCrudRepository.deleteById(Iterable<ID> ids).
Original pull request: #279.
2020-12-09 14:01:25 -08:00
Michael Reiche
788f7d999b DATACOUCH-672 - reinstate replace expiry tests (#289)
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2020-12-09 08:38:22 -08:00
Michael Reiche
f33cd3c79f DATACOUCH-666 - Handle immutable entity in replace. (#288)
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2020-12-09 08:37:01 -08:00
Michael Reiche
e97ef653e8 DATACOUCH-630 - Add expiry to replace 4.1.x. (#286)
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2020-12-09 07:56:39 -08:00
Mark Paluch
d925df2bc3 DATACOUCH-648 - After release cleanups. 2020-12-09 16:46:55 +01:00
Mark Paluch
b2a0e69417 DATACOUCH-648 - Prepare next development iteration. 2020-12-09 16:46:49 +01:00
Mark Paluch
57154e2bcb DATACOUCH-648 - Release version 4.1.2 (2020.0.2). 2020-12-09 16:01:27 +01:00
Mark Paluch
d313bac1c1 DATACOUCH-648 - Prepare 4.1.2 (2020.0.2). 2020-12-09 16:00:56 +01:00
Mark Paluch
3e8bda0d1e DATACOUCH-648 - Updated changelog. 2020-12-09 16:00:51 +01:00
Mark Paluch
d83036fbf0 DATACOUCH-640 - Updated changelog. 2020-12-09 15:33:31 +01:00
Mark Paluch
b73fd67c5c DATACOUCH-638 - Updated changelog. 2020-12-09 12:42:32 +01:00
Mark Paluch
9d50ed979b DATACOUCH-637 - Updated changelog. 2020-12-09 09:59:17 +01:00