Commit Graph

528 Commits

Author SHA1 Message Date
Mark Paluch
6a51b0c573 DATACOUCH-635 - Prepare 4.1 GA (2020.0.0). 2020-10-28 15:46:33 +01:00
Mark Paluch
3d52b583b8 DATACOUCH-635 - Updated changelog. 2020-10-28 15:46:28 +01:00
Mark Paluch
7c5be60f9e DATACOUCH-611 - Updated changelog. 2020-10-28 15:03:04 +01:00
Mark Paluch
29c37ba80d DATACOUCH-610 - Updated changelog. 2020-10-28 12:15:06 +01:00
Mark Paluch
eb35485f2d DATACOUCH-636 - Updated changelog. 2020-10-28 11:32:32 +01:00
Michael Reiche
182d45ab6e DATACOUCH-625 - Save doesn't return updated entity if immutable. (#274)
Modified applyUpdatedCas() to return accessor.getBean() which will
occur if the version property is Immutable.
Created applyUpdateId() that is analogous to applyUpdatedCas()
Factored out the equals() method that was used by a number of
test entity objects.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2020-10-22 10:54:43 -07:00
Haris Alesevic
a85720c8f4 DATACOUCH-619 - FindByMatchingQuery integration test
Verify that findByQuery works as expected (fixed as part of DATACOUCH-603)
2020-10-14 14:55:40 -07:00
Michael Reiche
1955cf45cd DATACOUCH-626 - Handle reading into entity with only all-args constructor; version primative type.
The version arg - which is not in the document - will be passed
into the constructor as a null which will fail if it is a primitive
type. This change will pre-populated the converted object with
the version/cas, so that it is not null.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2020-10-14 14:54:01 -07:00
Christoph Strobl
192fb27b60 DATACOUCH-612 - Prepare 4.1 RC2 (2020.0.0). 2020-10-14 14:27:38 +02:00
Christoph Strobl
cc15cd50c8 DATACOUCH-612 - Updated changelog. 2020-10-14 14:27:37 +02:00
Michael Reiche
0ce0f36b49 DATACOUCH-623 - Add replace() method to CouchbaseRepository for CAS usage. (#268)
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2020-10-12 17:16:01 -07:00
Michael Reiche
7c431d640f DATACOUCH-583 - Nested properties in queries not working. (#270)
The complete property path was being quoted instead of the individual
components.  ie.  `address.street` instead of `address`.`street`
Also fixed another issue - changed the maybeQuote() method for
property names to correctly look for back-tics instead of double
quotes and changed the name accordingly.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2020-10-12 13:22:19 -07:00
Michael Reiche
ed02ed535e DATACOUCH-632 - Fix compilation error introduced in DATACOUCH-603. (#269)
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2020-10-09 18:04:03 -07:00
Michael Reiche
1b5c32150e DATACOUCH-603 Do not cast query parameters in N1qlQueryCreator.
For IN and NOT_IN - they can take varargs, an array or a JsonArray
Don't cast query criteria parameters, let parameter accessor handle that.
Fixed conversion of query criteria values to parameters
Cleaned up QueryCriteria

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2020-10-09 14:59:16 -07:00
mikereiche
e72cdba6ee DATACOUCH-616 - Fix parsing of String Query containing conditionals in quotes
For a query as below that has conditional portions, the parsing for
parameters was being done before the conditional portions were being
resolved, which left the parameters between quotes where they wre
not being recognized as query parameters.

@Query("#{#n1ql.selectEntity} WHERE #{#n1ql.filter} " +
	" #{#projectIds != null ? 'AND iata IN $1' : ''} ")
Long count(@Param("projectIds") List<String> projectIds)
2020-10-05 10:45:40 -07:00
mikereiche
82edad5759 DATACOUCH-605 - Support ScanConsistency in n1ql queries 2020-10-05 10:14:03 -07:00
Haris Alesevic
fab72ee9c9 DATACOUCH-615 Use query in removeByQuery (#264)
* DATACOUCH-615 Use query in removeByQuery

Use provided query instead of hardcoded statement.

* DATACOUCH-615 Better method naming in Query class

* DATACOUCH-615 Replace hard-coded meta fields

* DATACOUCH-615 Test findByQuery.matching

* DATACOUCH-615 Remove failing test
2020-10-05 10:11:37 -07:00
mikereiche
2a06578145 DATACOUCH-620 - Fix nested object id/@Id issue.
Only treat the id (or @Id) field in top-level objects as the id.
2020-10-05 10:01:15 -07:00
mikereiche
ae43ed9949 DATACOUCH-604 - Fix NullPointerException when identifying Id fields. Handle @Field. 2020-09-16 13:46:48 -07:00
mikereiche
e9add0c90c DATACOUCH-608 - Propagate expiry option and annotation to insert and upsert calls. 2020-09-16 13:06:03 -07:00
mikereiche
4a52268f19 DATACOUCH-604 - Fix NPE when looking for Id field in interface.
This was failing with a repository for the domain object CouchbaseOAuth2AccessToken.
The following dependency is needed.

        <dependency>
            <groupId>org.springframework.security.oauth</groupId>
            <artifactId>spring-security-oauth2</artifactId>
            <version>2.4.1.RELEASE</version>
        </dependency>

package org.springframework.data.couchbase.domain;

import org.springframework.data.annotation.Id;
import org.springframework.data.couchbase.core.mapping.Document;
import org.springframework.data.couchbase.core.mapping.Field;
import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken;
import org.springframework.security.oauth2.common.OAuth2AccessToken;

@Document(expiry = 30 * 24 * 60 * 60)
public class CouchbaseOAuth2AccessToken extends DefaultOAuth2AccessToken {

	private static final long serialVersionUID = 6537949925775752989L;

	@Id
	private String tokenId;

	@Field
	private String authentication;

	@Field
	private String authenticationKey;

	@Field
	private String clientId;

	@Field
	private String userName;

	// getters and setters omitted for brevity

	private CouchbaseOAuth2AccessToken() {
		this((String) null);
	}

	public CouchbaseOAuth2AccessToken(OAuth2AccessToken accessToken) {
		super(accessToken);
		this.tokenId = accessToken.getValue();
	}

	public CouchbaseOAuth2AccessToken(String value) {
		super(value);
		this.tokenId = value;
	}

}
2020-09-16 13:04:07 -07:00
Mark Paluch
b69fcb8afe DATACOUCH-601 - Prepare 4.1 RC1 (2020.0.0). 2020-09-16 13:57:09 +02:00
Mark Paluch
5e3117da29 DATACOUCH-601 - Updated changelog. 2020-09-16 13:57:07 +02:00
Mark Paluch
16e86f83a1 DATACOUCH-602 - Updated changelog. 2020-09-16 12:16:35 +02:00
Mark Paluch
8242b53b17 DATACOUCH-592 - Updated changelog. 2020-09-16 11:20:11 +02:00
Mark Paluch
eeb03d076f DATACOUCH-591 - Updated changelog. 2020-09-16 10:39:02 +02:00
mikereiche
23d2f61d45 DATACOUCH-595 - Add cas to replace options if present on entity. 2020-09-11 15:18:27 -07:00
Mark Paluch
d9eefc22cb DATACOUCH-593 - Updated changelog. 2020-08-12 13:25:53 +02:00
Mark Paluch
a047126c36 DATACOUCH-578 - Prepare 4.1 M2 (2020.0.0). 2020-08-12 11:51:41 +02:00
Mark Paluch
2d2fc667e8 DATACOUCH-578 - Updated changelog. 2020-08-12 11:51:39 +02:00
Mark Paluch
7ff88a1400 DATACOUCH-568 - Updated changelog. 2020-07-22 10:38:02 +02:00
Mark Paluch
4694c83b1c DATACOUCH-567 - Updated changelog. 2020-07-22 10:08:48 +02:00
Mark Paluch
00ee63b040 DATACOUCH-566 - Updated changelog. 2020-07-22 09:44:34 +02:00
mikereiche
05fb9eadbe DATACOUCH-585 - Support ScanConsistency for count() queries. 2020-07-17 11:53:45 -07:00
mikereiche
e2444403a7 DATACOUCH-580 - Do not automatically insert n1ql.filter predicate in string query.
Since it is difficult to determine where the n1ql.filter (which typically
filters on _class), and also because it is not mandator, including
the n1ql.filter in the @query is left up to the author of the query.
Example:
@query("#{#n1ql.selectEntity} where #{#n1ql.filter} and lastname = $1")
2020-07-15 11:13:50 -07:00
mikereiche
d2456bb166 DATACOUCH-533 - Promote id field if no annotation id.
Promote id field if no annotation id.
Note that there is no longer any Couchbase @Id annotation - only
the Spring @id annotation.
2020-07-02 10:36:31 -07:00
mikereiche
ecaf58db75 DATACOUCH-532 - Use parameters in queries instead of literals.
This will allow query plans to be reused for different parameters.
2020-06-25 19:30:21 -07:00
mikereiche
5cd916bea4 DATACOUCH-577 - Fix tests that run only when using UNMANAGED couchbase server.
Some of the tests that run as UNMANAGED and pass when ran from intellij were
failing when ran from the command-line mvn, or when ran together will other tests.
2020-06-25 13:18:17 -07:00
Mark Paluch
1053a9b929 DATACOUCH-548 - Prepare 4.1 M1 (2020.0.0). 2020-06-25 11:48:20 +02:00
Mark Paluch
b39af3d939 DATACOUCH-548 - Updated changelog. 2020-06-25 11:48:18 +02:00
mikereiche
c7f41f57ed DATACOUCH-574 - Support countBy...() query method calls in repository. 2020-06-24 16:00:26 -07:00
mikereiche
cd595995ed DATACOUCH-573 - use same name for count in query 2020-06-23 12:40:01 -07:00
mikereiche
54d1a45b35 DATACOUCH-572 - fix compile error from DATACOUCH-571 2020-06-23 09:44:42 -07:00
mikereiche
fc67a7b541 DATACOUCH-569 - Add tests for DATACOUCH-560 - serialization of nested objects (CouchbaseDocument) and lists (CouchbaseList) 2020-06-22 11:07:47 -07:00
mikereiche
e1d39fdb6f DATACOUCH-571 fix delimiters in generated id
Also clean up test domain/Config.java
2020-06-22 11:01:17 -07:00
mikereiche
69f1ff5791 DATACOUCH-546 - set generated id on entity returned to caller 2020-06-19 14:56:37 -07:00
mikereiche
041b987eaf DATACOUCH-484 - thread safety parameters test 2020-06-16 13:37:22 -07:00
mikereiche
610c02c66e DATACOUCH-484 - test to demonstrate that parameters are thread-safe 2020-06-15 13:00:25 -07:00
Andrea Torlaschi
c7f12a2237 DATACOUCH-560 - Serialization of CouchbaseDocument and CouchbaseList.
Add support for saving document with lists and composed objects.
Convert CouchbaseDocument/CouchbaseList to Map/List before saving.
2020-06-10 12:27:15 -07:00
Mark Paluch
dddee9fb82 DATACOUCH-547 - Updated changelog. 2020-06-10 14:31:01 +02:00