Commit Graph

784 Commits

Author SHA1 Message Date
Christoph Strobl
0e2e84ca6a DATACOUCH-612 - Updated changelog. 2020-10-14 14:51:52 +02:00
Michael Reiche
534d704413 DATACOUCH-623 - Add replace() method to CouchbaseRepository for CAS usage. (#268)
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2020-10-12 17:24:23 -07:00
Michael Reiche
d383d08867 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 15:43:12 -07:00
Michael Reiche
e4068b9a4e 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-12 15:26:36 -07:00
mikereiche
87397023e8 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-12 15:09:07 -07:00
mikereiche
b54dfcaf1c DATACOUCH-605 - Support ScanConsistency in n1ql queries
Also fixes expiry bug
2020-10-12 14:30:33 -07:00
Haris Alesevic
7026a39589 DATACOUCH-615 - Use query in removeByQuery.
Use provided query instead of hardcoded statement.
Better method naming in Query class
Replace hard-coded meta fields
Test findByQuery.matching
Remove failing test
2020-10-12 14:25:32 -07:00
mikereiche
653282c5b9 DATACOUCH-620 - Fix nested object id/@Id issue.
Only treat the id (or @Id) field in top-level objects as the id.
2020-10-12 14:17:24 -07:00
mikereiche
6c4992b4b1 DATACOUCH-608 - Propagate expiry option and annotation to insert and upsert calls. 2020-10-12 14:10:31 -07:00
mikereiche
10568a469f 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-10-12 14:02:54 -07:00
mikereiche
59b6091f06 DATACOUCH-595 - Add cas to replace options if present on entity. 2020-10-12 13:49:42 -07:00
mikereiche
2b62059550 DATACOUCH-595 - Add cas to replace options if present on entity. 2020-10-12 13:42:42 -07:00
mikereiche
5fff02849c DATACOUCH-608 - Propagate expiry option and annotation to insert and upsert calls. 2020-09-16 14:35:28 -07:00
mikereiche
bfa2c93720 DATACOUCH-604 - Fix NullPointerException when identifying Id fields. Handle @Field. 2020-09-16 13:51:20 -07:00
Mark Paluch
a989e710e6 DATACOUCH-601 - Updated changelog. 2020-09-16 14:12:12 +02:00
Mark Paluch
bdec69913a DATACOUCH-602 - After release cleanups. 2020-09-16 12:15:47 +02:00
Mark Paluch
6205a1d58e DATACOUCH-602 - Prepare next development iteration. 2020-09-16 12:15:43 +02:00
Mark Paluch
d3f7b24ac4 DATACOUCH-602 - Release version 4.0.4 (Neumann SR4). 2020-09-16 11:43:15 +02:00
Mark Paluch
f66a2c9bd4 DATACOUCH-602 - Prepare 4.0.4 (Neumann SR4). 2020-09-16 11:42:47 +02:00
Mark Paluch
4022a96121 DATACOUCH-602 - Updated changelog. 2020-09-16 11:42:45 +02:00
Mark Paluch
e467e79681 DATACOUCH-592 - Updated changelog. 2020-09-16 11:20:13 +02:00
Mark Paluch
960c21d72e DATACOUCH-591 - Updated changelog. 2020-09-16 10:39:06 +02:00
Mark Paluch
f4fc818a98 DATACOUCH-607 - Upgrade to Couchbase SDK 3.0.8. 2020-09-14 15:15:05 +02:00
Mark Paluch
f789dc5422 DATACOUCH-593 - After release cleanups. 2020-08-12 13:19:59 +02:00
Mark Paluch
94cfe26ec3 DATACOUCH-593 - Prepare next development iteration. 2020-08-12 13:19:56 +02:00
Mark Paluch
bd9ec25ebf DATACOUCH-593 - Release version 4.0.3 (Neumann SR3). 2020-08-12 13:07:48 +02:00
Mark Paluch
f24536c0dd DATACOUCH-593 - Prepare 4.0.3 (Neumann SR3). 2020-08-12 13:07:22 +02:00
Mark Paluch
e6362aee3c DATACOUCH-593 - Updated changelog. 2020-08-12 13:07:19 +02:00
Mark Paluch
d5f0500a67 DATACOUCH-578 - Updated changelog. 2020-08-12 12:01:28 +02:00
Mark Paluch
d6f875e81b DATACOUCH-599 - Upgrade to Couchbase SDK 3.0.7. 2020-08-10 11:15:19 +02:00
Mark Paluch
0ff5926eb8 DATACOUCH-568 - After release cleanups. 2020-07-22 10:37:09 +02:00
Mark Paluch
d3b841391d DATACOUCH-568 - Prepare next development iteration. 2020-07-22 10:37:07 +02:00
Mark Paluch
3e0d53dc03 DATACOUCH-568 - Release version 4.0.2 (Neumann SR2). 2020-07-22 10:21:10 +02:00
Mark Paluch
2894593776 DATACOUCH-568 - Prepare 4.0.2 (Neumann SR2). 2020-07-22 10:20:45 +02:00
Mark Paluch
b62b512274 DATACOUCH-568 - Updated changelog. 2020-07-22 10:20:43 +02:00
Mark Paluch
f883c97ff9 DATACOUCH-567 - Updated changelog. 2020-07-22 10:08:50 +02:00
Mark Paluch
bd6ebcecfe DATACOUCH-566 - Updated changelog. 2020-07-22 09:44:37 +02:00
Mark Paluch
9e4b096f15 DATACOUCH-586 - Upgrade to Couchbase Driver 3.0.6. 2020-07-22 08:55:03 +02:00
mikereiche
3516b38d18 DATACOUCH-585 - Support ScanConsistency for count() queries. 2020-07-20 21:48:46 -07:00
mikereiche
5de6cacd8d 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-20 21:48:25 -07:00
mikereiche
68811a4165 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-20 21:47:59 -07:00
mikereiche
5cd5487485 DATACOUCH-532 - Use parameters in queries instead of literals.
This will allow query plans to be reused for different parameters.
2020-07-20 21:47:42 -07:00
mikereiche
a08157cc5a 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-07-20 21:45:19 -07:00
mikereiche
2e2aecf5f1 DATACOUCH-574 - Support countBy...() query method calls in repository. 2020-07-20 21:22:55 -07:00
mikereiche
b7543dfaf4 DATACOUCH-573 - use same name for count in query 2020-07-20 21:22:13 -07:00
mikereiche
aa58e9c4ec DATACOUCH-572 - fix compile error from DATACOUCH-571 2020-07-20 21:21:56 -07:00
mikereiche
313bc1e868 DATACOUCH-569 - Add tests for DATACOUCH-560 - serialization of nested objects (CouchbaseDocument) and lists (CouchbaseList) 2020-07-20 21:21:39 -07:00
mikereiche
d89866110a DATACOUCH-571 fix delimiters in generated id
Also clean up test domain/Config.java
2020-07-20 21:21:24 -07:00
mikereiche
3d6117d060 DATACOUCH-546 - set generated id on entity returned to caller 2020-07-20 21:20:58 -07:00
mikereiche
9cb9bb9ede DATACOUCH-484 - thread safety parameters test 2020-07-20 21:20:22 -07:00