Commit Graph

257 Commits

Author SHA1 Message Date
Michael Reiche
f3f405db4c Refresh test entity class. (#1645)
Closes #1644.
2023-01-11 13:53:50 -08:00
Michael Reiche
b7d2c8fd03 Add missing test entity class. (#1643)
Closed #1642.
2023-01-11 13:53:46 -08:00
Michael Reiche
5b04d59571 Use getAndTouch only when annotation attribute touchOnRead=true. (#1641)
Closes #1634.
2023-01-11 13:53:42 -08:00
Michael Reiche
7800cf7a27 Take expiry from entity class annotation for getAndTouch. (#1640)
Closes #1634.
2023-01-10 16:56:37 -08:00
Michael Reiche
3cba5d9aad Use "= true" for TRUE() and "= false" for FALSE(). (#1633)
Closes #1627.
2023-01-03 15:44:55 -08:00
Mark Paluch
4134eb6fcc Extend license header copyright years to 2023.
See #1631
2023-01-02 09:52:10 +01:00
Michael Reiche
d3f1095474 Fix arrayContaining n1ql generated. (#1548)
Closed #1545.
2022-08-26 16:24:28 -07:00
Michael Reiche
935dd1f808 Add support for ignoreCase in queries derived from method names.
Closes #984, #1481.
2022-08-26 16:23:19 -07:00
Rémi Bleuse
a2a48caf79 Allow document ID to be other than String (#1534)
* fixes #1529

* add author
2022-08-08 10:05:29 -07:00
Michael Reiche
31a9fe7e98 Move tests needing server to IntegrationTests.
Closes #1472.
2022-06-17 13:52:43 -07:00
Michael Reiche
857a364ff0 Update ReactiveAirportRepository.java 2022-06-17 11:05:33 -07:00
Michael Reiche
797a454108 Fix 1441 in 4_4_x - scope and collection not considered in repo delete.
This is a more localized change than the one in main.

Closes #1464.
2022-06-17 11:05:33 -07:00
Michael Reiche
f052aa4826 Add n1ql.scope and n1ql.collection spel expressions for @Query.
This adds n1ql.scope and n1ql.collection spel expressions for
@Query so that n1ql.bucket doesn't need to be overloaded with
the collection name. This will make the bucket name available
in n1q.bucket.

This is a breaking change as queries that used n1ql.bucket to
get the collection name (especially in the case of pre-scope-
and-collection @Queries that (a) referenced n1ql.bucket instead
of referencing other spel expressions that include the
bucket/collection name; and (b)  still worked after the
repository was moved from a bucket onto a collection by
virtue of n1ql.bucket having the value of the collection in
such instances.

Closes #1445.
2022-06-16 10:03:14 -07:00
Michael Reiche
b76ee48240 Add BigDecimal converter.
Add BigDecimal converter, add converter tests for BigDecimal and BigInteger.
Since BigDecimail is not support, it cannot be used in the CustomerConverter tests.
So instead use ChoiceFormat for CustomConverter tests.

Closes #1439.
2022-06-16 10:00:09 -07:00
Michael Reiche
8847544025 Only project id and cas if required. (#1404)
Closes #1402.
2022-05-09 13:34:42 -07:00
Michael Reiche
b1272bc49a Fix Collection Support for Cache for non-Collection Server. (#1418)
Also fix test setup index flakiness on older servers.

Closes #1417.
2022-05-09 13:34:19 -07:00
Michael Reiche
9fe8472b37 Check for _ID and _CAS as well as __id and __cas being projected from query and analytics. (#1390)
Closes #1389.
2022-05-09 13:18:53 -07:00
Michael Reiche
4a42cba52e Support testing against Capella. (#1386)
Support testing against Capella. Also includes sample to
use Capella control-plane.

Closes #1385.
2022-05-09 13:12:51 -07:00
Michael Reiche
9347a5097a Quotes around bucket name in setup for collection tests. (#1416)
Closes #1415.
2022-04-19 18:30:15 -07:00
Michael Reiche
c288d053c9 Querydsl support. (#1330)
Closes #1288.
2022-03-31 08:04:17 -07:00
Michael Reiche
fe59e0c945 Fix cache to use collections part 2. (#1373)
Closes #1369.
2022-03-15 20:52:34 -07:00
Michael Reiche
13d8b6dbc7 Fix cache.clear() to use collection. (#1371)
Closes #1369.

Co-authored-by: Michael Reiche <michael.reiche@couchbase.com>
2022-03-15 20:13:07 -07:00
Michael Reiche
3ec3a3080a Support derived queries on repositories defined with an abstract entity class. (#1366)
Motivation:
Currently an abstract entity class specified in the repository definition can
be used for the predicate typeKey = typeAlias(of abstract entity class) in
queries. Since documents are stored with typeKey = typeAlias(of concrete class)
those queries will never match any documents.  To allow this to work,
all of the abstract entity class an all concrete subclasses must use the
same typeAlias.

Once those documents are found, regardless of their concrete class,
they will all have the same typeKey = typeAlias, instead of having the
typeAlias specific to the concrete class. Additional information in
the stored document is needed to identify the concrete class (subtype
in the example test case), as well as a TypeMapper to interpret that
 information.

Changes:
This allows a common TypeAlias to be used for the purpose of the predicate
typeKey = typeAlias, and the determination of the concrete type by
implementing an AbstractingMappingCouchbaseConverter that inspects the
'subtype' property.

Closes #1365.

Co-authored-by: Michael Reiche <michael.reiche@couchbase.com>
2022-03-14 09:37:51 -07:00
Michael Reiche
d9327ceea2 Fix update to cache documentation. (#1359)
Closes #1358.
2022-02-22 10:09:25 -08:00
Michael Reiche
5804dd5a7e Reinstate CouchbaseCache documentation. (#1357)
Closes #1356.
2022-02-22 09:56:53 -08:00
Michael Reiche
83f55b1bda Allow CouchbaseCacheConfiguration to set collection. (#1344)
Closes #1343.
2022-02-16 09:32:14 -08:00
Michael Reiche
1fcd252b68 Translate CasMismatchException to OptimisticLockingFailureException. (#1341)
Translate CasMismatchException to OptimisticLockingFailureException
instead of DataIntegrityViolationException.  CasMismatchException is
a ConcurrencyFailureException which is a TransientDataAccessException.
Versus DataIntegrityViolation, which is a NonTransientDataAccessException.

Closed #1339.
2022-02-15 11:38:25 -08:00
Michael Reiche
fc075ccdeb Add collections support to N1qlJoin. (#1333)
The scope for the entity can come from an option, a method annotation,
an annotation on the repository or an annotation on the entity class.
All these possibilities are handle by PseudoArgs in the
OperationSupport implementation. That scope/collection are passed
into decodeEntity(). The scope/collection of the child can only come
from an annotation on the entity class. The scope/collection of the
parent and child are uses as follows:

1) Both the parent and the chold have non-default collections
It's possible that the scope for the parent was set with an annotation on
a repository method, the entity class or the repository class or a query
option. Since there is no means to set the scope of the child class by the
method, repository class or query option (only the annotation) we assume
that the (possibly) dynamic scope of the entity would be a better choice
as it is logical to put collections to be joined in the same scope.

2) The parent has a collection (and therefore a scope as well), but the
child  does not have a collection. Use the lhScope and lhCollection for
the entity.  The child is just the bucket.

3) The parent does not have a collection (or scope), but child does have a
collection. Using the same (default) scope for the child would mean
specifying a non-default collection in a default scope - which is not
allowed. So use the scope and collection from the child class.

4) Neither have collections, just use the bucket.

Closes #1325.
2022-02-15 11:37:54 -08:00
Michael Reiche
ef56e3f3aa Add mechanism for save to do one of insert, replace or upsert. (#1316)
Closes #1277.
2022-02-14 09:10:04 -08:00
Michael Reiche
5c5dde3db1 Collection support for predicates on meta fields. (#1338)
When a derived query is being created and there is a predicate on
a meta-field ( meta().id, cas, expiry), translate that field
(i.e. id -> meta().id) *without* the bucket or collection name,
as it might apply to a collelction which we do not know yet
(for instance, if there is a withCollection() specified)..
This is fine, because in a derived query, meta() without the
bucket or collection name is unambigous.
2022-02-14 09:09:09 -08:00
Michael Reiche
19c9e16717 Make withDurability() return WithScope type for all operations. (#1340)
Some of the operations were mistakenly declared to return a
WithCollection type, making it impossible to call the inScope()
method.

Closes #1329.
2022-02-11 08:22:04 -08:00
Michael Reiche
e20ebae10e Have tests remove the documents they insert. (#1336)
Closes #1335.
2022-02-09 21:56:22 -08:00
Michael Reiche
32f6a05462 Javadoc and other java 1_8 compatible changes in 50x back to main. (#1328)
Closes #1327.
2022-02-08 13:50:25 -08:00
Michael Reiche
c88a35c152 Fix slice support. (#1324)
Fix slice support. Also discontinue use of deprecated class.

Closes #1323.
2022-02-08 09:45:20 -08:00
Michael Reiche
895b2b270e Restore projection of class. (#1319)
Restore projection of class in queries. This is necessary for abstract repositories.

Closes #1315.
2022-02-03 06:19:32 -08:00
Michael Reiche
02bc0b35d3 Fix regression in IN operator. (#1309)
The regression occurred in changes for https://issues.couchbase.com/browse/MB-26606.

Closes #1308.
2022-01-25 10:11:35 -08:00
Michael Reiche
317d9b877c Allow caching null objects. (#1303)
Closes #939.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2022-01-17 14:17:53 -08:00
Michael Reiche
e15c6d0b4b Copy sort from pageable to query. (#1305)
Closes #1304.
2022-01-17 11:01:56 -08:00
Michael Reiche
3a216a83b4 Incorporate changes from 5.0.x and bump Couchbase SDK. (#1287)
Closes #1286.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2022-01-06 15:00:49 -08:00
Michael Reiche
6c6acf8ae2 Handle Collection<> parameters to repository query methods. (#1271)
Closes #1270.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2021-11-12 07:15:45 -08:00
yyfMichaelYan
d8d249502d fix flaky test writesAndReadsCustomFieldsConvertedClass (#1264) 2021-11-08 11:40:01 -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
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