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>
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>
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>
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>
It was present on non-Reactive, but missing from reactive.
Closes#1096.
Original pull request: #1108.
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
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>
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>
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>