Commit Graph

635 Commits

Author SHA1 Message Date
Michael Reiche
49e7de06d8 Port to jdk17 and spring 3.0.0 (#1279)
This also allows support of repository methods that return a simple type.
i.e.
@ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS)
@Query("SELECT iata, \"\" as __id, 0 as __cas from #{#n1ql.bucket} WHERE #{#n1ql.filter}")
List<String> getStrings();

Closes #1278.
2021-12-09 15:50:52 -08:00
Michael Reiche
9f2d7ee6b5 Field named id treated as document id. (#1261)
Closes #1258.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-10-26 10:52:50 -07:00
Michael Reiche
e1b0ea98d9 Reinstate the getDefaultConsistency() method in the Configuration. (#1249)
Closes #1243.
2021-10-22 11:42:55 -07:00
Mark Paluch
17e6d8525f Prepare 4.3 RC1 (2021.1.0).
See #1236
2021-10-18 13:47:48 +02:00
Michael Reiche
37648c80d0 Unbean couchbaseObjectMapper(). (#1240)
Closes #1209.
2021-09-23 09:20:04 -07:00
Mark Paluch
0d3fb83030 Prepare 4.3 M3 (2021.1.0).
See #1183
2021-09-17 09:44:35 +02:00
Michael Reiche
a472e2a1a5 Expose TemplateSupport from Template. (#1233)
Closes #1210.
2021-09-16 12:05:50 -07:00
Michael Reiche
66cc1b5491 Changes for PR 1223 that I had missed. (#1230)
Closes #1229.
2021-09-14 16:38:11 -07:00
Michael Reiche
b9fa1c76ab Fix test failure against mocked. (#1227)
Closes #1226.
2021-09-14 11:10:16 -07:00
Michael Reiche
1e774d460b Test case for exceptions thrown from events - validation. (#1225)
Closes #1224.
2021-09-14 10:09:51 -07:00
Michael Reiche
a879d0b4e3 Use expiry(duration) with duration. (#1223)
Also adds test for exceptions thrown during events - with validator.

Closes #1204.
2021-09-14 09:49:12 -07:00
Michael Reiche
7c1167f302 Specifying withExpiry(Duration) on findById() uses getTouchAndRead(). (#1196)
Closes #982.
2021-09-13 11:21:23 -07:00
Michael Reiche
345af53930 Pass source as parent when reading subobject. (#1222)
Closes #1221.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-09-13 11:11:05 -07:00
Michael Reiche
da3e8e0e36 Support N1QL Join Annotations. (#1211)
* Support N1QL Join Annotations.

Closes #1198.
2021-09-12 18:38:01 -07:00
Michael Reiche
4bd82ea23c Add project(fields) to findByQuery similar to same method on findById. (#1212)
Closes #1208, #1213.
2021-09-12 17:17:47 -07:00
Michael Reiche
edaf11ed85 Log warning message and rethrow exceptions from events. (#1207)
Closes #1206.
2021-08-26 15:09:34 -07:00
Michael Reiche
bcf11ce856 Support derived queries from methods named findDistinctF1AndF2ByF3() (#1202)
Support derived queries from methods named findDistinctF1AndF2ByF3().

Closes #1200.
2021-08-23 13:51:55 -07:00
Michael Reiche
f0880daf7a Fix ArrayIndexOutOfBoundsException on String queries that use paging. (#1197)
Closes #1155.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-08-23 13:06:57 -07:00
Michael Reiche
dffd203a57 Remove the sort from query before executing count. (#1194)
Also creates the query with skip and limit from any Pageable parameter instead of applying it later.
Closes #1191.
2021-08-18 09:07:15 -07:00
Michael Reiche
7e2963a365 Throw an explicit exception if count query does not return a count. (#1195)
Also just use the first projected property instead of one explicitly named "count".

Closes #925,#960.
2021-08-18 09:06:43 -07:00
Michael Reiche
6344b94825 Add target annotation to expiry annotation. (#1193)
It should have already had this as it was being used as an annotation
in AirportRepository.ComposedMetaAnnotation.
I believe a recent update to intellij now flags it as an error in the IDE.

Closes #1192.
2021-08-17 11:21:52 -07:00
Michael Reiche
07022c1e86 Remove unnecessary auditorAwareRef from test config. (#1189)
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.
2021-08-17 10:35:33 -07:00
Michael Reiche
f8b5ab205c Log exceptions thrown from events. (#1187)
Closes #1075.
2021-08-16 13:15:22 -07:00
Michael Reiche
5e92a99996 Fix links to snapshot and milestone in doc. (#1178)
The urls in the example are ok, but when the hot link in the
text is clicked on, it redirects to a 404. This fixes the hot links.

Closes #1177.
2021-08-16 13:04:13 -07:00
Michael Reiche
fada241988 N1ql query should project getFieldName() instead of getName(). (#1185)
Closes #1184.
2021-08-16 13:02:55 -07:00
Michael Reiche
d210678c78 Field(name=myName) annotation work like Field(myName) and Field(value=myName). (#1186)
Closes #1068.
2021-08-16 12:55:02 -07:00
Michael Reiche
52b1832cb5 Expiration annotation on field will retrieve expiration in N1ql queries. (#1188)
Closes #1060.
2021-08-16 12:53:46 -07:00
Michael Reiche
6512fc087b To support jdk 16, add converters and module-info. (#1167)
To support jdk 16, add converters and module-info.

Closes #1057.
2021-08-13 11:28:04 -07:00
Michael Reiche
351370ba4d Do not scan Persistent annotated classes. (#1180)
Only scan Document annotated classes.

Closes #1121.
2021-08-13 11:27:11 -07:00
Jens Schauder
08408b9c3f Prepare 4.3 M2 (2021.1.0).
See #1163
2021-08-12 15:02:57 +02:00
Michael Reiche
51b0d32636 Add Transient, Stream and Flux Pair tests. (#1175)
Closes #1174.
2021-08-11 14:45:01 -07:00
Michael Reiche
7d5e33ad71 Handle auto index on field path. (#1169)
Closes #1166.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-08-11 10:29:05 -07:00
Michael Reiche
9e3bfe5b71 Omit annotations from the repository and domaintype in CrudMethodMetadata. (#1170)
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>
2021-08-10 20:17:12 -07:00
Michael Reiche
7cde6b919e Scopes and collections for repositories (#1149)
* 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>
2021-08-09 09:57:29 -07:00
Jens Schauder
f5866dc95a Prepare 4.3 M1 (2021.1.0).
See #1129
2021-07-16 14:08:59 +02:00
Jens Schauder
42f3827a0c Updated changelog.
See #1129
2021-07-16 14:08:53 +02:00
Jens Schauder
e16f91206a Updated changelog.
See #1152
2021-07-16 10:48:19 +02:00
Mark Paluch
c4954f660d Updated changelog.
See #1139
2021-06-22 16:07:28 +02:00
Mark Paluch
9b7415e78d Updated changelog.
See #1138
2021-06-22 15:29:54 +02:00
Michael Reiche
155663e66f Add missing hooks for callbacks. (#1142)
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>
2021-06-09 21:54:24 -04:00
Michael Reiche
67a7937cd2 Improve framework for custom mapping couchbase converter. (#1148)
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>
2021-06-09 21:36:45 -04:00
Jorge Rodríguez Martín
d172f395a8 Restore feature 'Inject translation service bean in CouchbaseTemplateSupport'.
The feature was accidentally removed when DATACOUCH-550 was reverted.

Closes #1140.
2021-06-03 17:42:49 -04:00
Michael Reiche
43889e6a9c Scope and collection API for template. (#1133)
Scope and Collection API for template.

Closes #963.
Original pull request: #1071.
2021-06-02 09:38:02 -04:00
Mark Paluch
5cf142d5f2 Updated changelog.
See #1127
2021-05-14 12:36:39 +02:00
Mark Paluch
3cce0b3b89 Updated changelog.
See #1126
2021-05-14 12:06:42 +02:00
Michael Reiche
a80663119c Expose ObjectMapper used by JsonSerializer (#1132)
Closes #1130.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-05-05 12:16:38 -07:00
Michael Reiche
36de313466 Add override of toN1qlRemoveString() to StringQuery. (#1135)
Closes #1131.
Original pull request: #1135.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-05-04 07:25:18 -07:00
Mark Paluch
1f41de4794 Prepare 4.2 GA (2021.0.0).
See #1117
2021-04-14 14:18:23 +02:00
Mark Paluch
c54c8d3c39 Updated changelog.
See #1117
2021-04-14 14:18:19 +02:00
Mark Paluch
70c618aa67 Updated changelog.
See #1118
2021-04-14 11:43:34 +02:00