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.
Omit annotations from the repository and domaintype in
CrudMethodMetadata as they may be different for the same method.
The annotations from the repository and domaintype are obtained directly
in CouchbaseRepositoryBase.
Closes#1168.
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
* Add support for scopes and collections for repositories.
Adds DynamicProxyable and DynamicInvocationHandler to
set scope/collection/options on PseudoArgs when calling
operations via repository interfaces.
Closes#963.
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
1) the previous change (#955) to CouchbaseAuditingRegister intended to register
AuditingEntityCallback instead of AuditingEventListener but only changed the
name that AuditingEventListener was registered with. Since
AuditingEventListener does exactly the same thing as AuditingEntityCallback,
it behaved as those AuditingEntityCallback was being used.
2) It seems that the two mechanisms - EntityCallback and EventListener
both do more-or-less the same thing. I'm not sure why there are two
mechanisms to do the same thing.
3) Although the ReactiveAuditingEntityCallback mechanism is triggered
only for reactive operations and the non-reactive AuditingEntityCallback
is triggered only for non-reactive operations, the events are triggered
for both. Since there was a desire to have distinct callbacks for
reactive/non-reactive operations, I also made distinct events for
reactive/non-reactive operations. However both the reactive and non-reactive
event mechanisms are triggered for either reactive and non-reactive operations,
so it is necessary for the mechanism to determine if it should act on the
event.
4) Although there is an AbstractCouchbaseEventListener that is extended by
LoggingEventListener and ValidatingEventListener, AuditingEventListener does
not extend it (maybe it should).
Closes#1074.
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
1) change examples in Config to show creating repository mappings using
existing MappingCouchbaseConverter (which have customConversions /
BeanNames.COUCHBASE_CUSTOM_CONVERSIONS and applicationContext)
instead of creating their own and then adding the customConversion and
applicationContext.
2) replace @Autowired couchbaseObjectMapper with couchbaseObjectMapper()
to avoid the following when using @ComponentScan :
Unsatisfied dependency expressed through field 'couchbaseObjectMapper';
nested exception is org.springframework.beans.factory.
BeanCurrentlyInCreationException: Error creating bean with name
'couchbaseObjectMapper': Requested bean is currently in creation: Is
there an unresolvable circular reference?
3) remove unused members fro StringBasedN1qlQueryParser
Closes#1141.
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
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>
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 - 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>
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>
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>