Commit Graph

167 Commits

Author SHA1 Message Date
Subhashni Balakrishnan
2f0e255fbb DATACOUCH-415 - Improve performance by re-using the same set instance
Reuse the same instance of the set instead of recreating each time

Original PR: #176
2019-02-12 16:29:06 -08:00
Subhashni Balakrishnan
580a50b40f DATACOUCH-388 Add support for ANSI-JOIN across entities
Motivation
----------
To support ANSI JOIN across associated entities

Changes
-------
N1qlJoin annotation on an associated entity field is discovered by the
couchbaseTemplate, which uses N1qlJoinResolver to build and resolve the
query. The query can be resolved eagerly or lazily based on the fetch
type configuration. The retrieved results are then mapped to the
associated entity. In the lazy resolver, a proxy is set on the property
which resolves on the first access.

Results
-------
Verified by unit and integration tests. ANSI join is now possible across
entities.

Original PR: #174
2019-02-12 09:56:58 -08:00
Mark Paluch
f4116f6de6 DATACOUCH-425 - Update copyright years to 2019. 2019-01-02 12:31:10 +01:00
Subhashni Balakrishnan
c4491dc8b4 DATACOUCH-413 Use parameterized queries for Query derivation
Changes
-------
- N1ql query creators implement an interface which provides the place
holder values.
- The query creator uses a position index counter to inject place holders in
the statement created and caches the place holder values in an array.
- Repository query constructor passes the generated query statement
and place holder values to query through the SDK.
- Cleanup N1ql integration tests for count validation and also add
couple of more tests

Results
-------
The testing for changes are already covered under the modified existing tests
in N1qlQueryCreator and Repository.
2018-11-26 11:23:14 -08:00
Subhashni Balakrishnan
9840acd2c6 DATACOUCH-384 - Apply converters to string based query parameters
Apply the converters registered to serialize the positional and named
parameters to match the database representation

Original Pull Request: #172.
2018-11-07 14:39:11 -08:00
Subhashni Balakrishnan
5af4dae334 DATACOUCH-401 Fix incorrect return type for reactive string based N1ql count query
Motivation
----------
Reactive string based N1QL count query incorrectly returns the map after
the single result projection.

Changes
-------
Map the observable returning from the N1ql query result deserialized to
a map by converting to the correct return type using the conversion
service. Verified by integration tests.
2018-09-20 23:06:36 -07:00
Subhashni Balakrishnan
5fbfd78220 DATACOUCH-386 Improve javadoc for setWriteResultChecking 2018-09-20 22:45:59 -07:00
Subhashni Balakrishnan
e360c23d92 DATACOUCH-376 - Apply custom conversions for collection elements
Original Pull Request: #164.
2018-07-16 11:10:43 -07:00
Subhashni Balakrishnan
076dcc0219 DATACOUCH-389 - Update to Couchbase-Java-Client 2.6.0
Added the new committed environment configurables to the xml based
configuration parser info. Also added couchbase FLE encryption library as bean
instantiation introspects class methods and fails with ClassNotFound
exception.

Original Pull Request: #165.
2018-07-16 10:25:56 -07:00
Oliver Gierke
ed6820e3a4 DATACOUCH-390 - Adapt API changes for immutable entity support.
Related tickets: DATACMNS-1322.
2018-07-12 16:26:03 +02:00
Oliver Gierke
3713181083 DATACOUCH-379 - Adapt to SpEL extension API changes in Spring Data Commons.
Related tickets: DATACMNS-1260.
2018-05-15 10:00:45 +02:00
Oliver Gierke
b18761b409 DATACOUCH-373 - Adapt to API changes in Spring Data Commons.
Related tickets: DATACMNS-1275.
2018-04-09 14:56:27 +02:00
Mark Paluch
a46f8160a9 DATACOUCH-368 - Export composable repositories via CDI.
We now export composable repositories through our CDI extension. Repositories can now be customized either by a single custom implementation (as it was before) and by providing fragment interfaces along their fragment implementation.

This change aligns CDI support with the existing RepositoryFactory support we provide within a Spring application context.
2018-03-12 16:55:30 +01:00
Subhashni Balakrishnan
0960f11a9c DATACOUCH-322 - Add RBAC username and password support
Motivation
----------
Couchbase server 5.0 allows role based access control and this allows
for users to be created and granted access to use bucket. Expose this
feature in SDC.

Changes
-------
1. Couchbase configurations allow for user name to be set. The user password
property is still retrieved from bucket password property.
2. CouchbaseFactoryBean has additional constructor for the username
property.
3. Couchbase bucket schema for xml configurations also includes username
property.
4. Integration tests have been restructured majorly to accomadate for
username
    - Testcontainers are used to allow for container based testing.
    - Container based testing is optional, it can be configured using
      resources/server.properties

Results
-------
The RBAC change has been tested with pre 5.0 and 5.0+ versions using
containers. The tests pass.

Original pull request: #158.
2018-03-07 15:09:15 -08:00
Subhashni Balakrishnan
039e106032 DATACOUCH-362 - Use dynamic proxying
Dynamic proxying for couchbase environment instead of an explicit no shutdown
proxy.

Original pull request: #157.

DATACOUCH-363 - Upgrade to 2.5.5

Java client upgrade. Remove the dcpEnabled property from
CouchbaseEnvironment factory bean and parser.

Original pull request: #157.
2018-03-07 13:26:55 -08:00
Mark Paluch
e8c647fb9d DATACOUCH-350 - Polishing.
Add test to verify configuration extension. Fix reactive module name to match non-reactive module name. Add author tags. Reorder methods, add javadoc comments.

Original pull request: #153.
2017-11-25 11:08:51 +01:00
Alex Derkach
322642515a DATACOUCH-350 - Consider repository type in configuration extensions.
We now check in configuration extensions whether the extension is capable to implement the repository by considering whether a repository is a reactive one. This prevents the non-reactive extension from implementing reactive repositories and vice versa.

Original pull request: #153.
2017-11-25 11:07:13 +01:00
Ben Benoit
4908749bcd DATACOUCH-328 - Fix document expiry when using expressions
When using an expiry expression with TimeUnit.DAYS larger than 30 days
the document expiry is not correctly set.

Original pull request: #150.
2017-10-17 11:34:12 -07:00
Oliver Gierke
5f24502175 DATACOUCH-330 - Improved detectability of Couchbase repositories in strict configuration mode.
We now make sure that repositories for domain types annotated with @Document or extending CouchbaseRepository are considered strict repository candidates.
2017-08-28 11:24:48 +02:00
MLabusquiere
761c08517b DATACOUCH-329 - Save repo return with the generated id
Original pull request: #151.
2017-08-24 13:49:00 -07:00
Mark Paluch
9218b09f26 DATACOUCH-320 - Adapt to API changes in mapping subsystem. 2017-07-04 14:37:18 +02:00
Christoph Strobl
0786cda78d DATACOUCH-314 - Adopt to ReactiveCrudRepository.deleteById(Publisher).
Related ticket: DATACMNS-1063.

Original Pull Request: #147
2017-06-13 19:56:55 +02:00
Mark Paluch
55832cfa21 DATACOUCH-314 - Adopt to ReactiveCrudRepository.findById(Publisher) and existsById(Publisher).
Related ticket: DATACMNS-1063.

Original Pull Request: #147
2017-06-13 19:56:15 +02:00
Subhashni Balakrishnan
047921956b DATACOUCH-309 Convert IDs as well if custom conversions are available in Simple Repository
Original pull request: #146.
2017-06-12 17:26:45 -07:00
Subhashni Balakrishnan
c7e4801305 DATACOUCH-310 - Convert N1ql query parameter enums to string values
Original pull request: #148.
2017-06-12 17:24:11 -07:00
Subhashni Balakrishnan
70343b0ac1 DATACOUCH-296 Add support for delete n1ql queries
Changes to support delete query by query derivation and SpEL based
queries.
- Adds a N1qlMutateQueryCreator which constucts the delete query
using dsl.
- Adds new SpEL values delete and returning required for delete
queries.

Original pull request: #144.
2017-06-12 17:22:53 -07:00
Mark Paluch
9758ad9802 DATACOUCH-311 - Upgrade to Reactor 3.1 M2.
Adopt to API change from Publisher.subscribe() to Publisher.toProcessor().
2017-06-01 10:01:39 +02:00
Oliver Gierke
22205678ef DATACOUCH-305 - Adapt to API changes in repository interfaces. 2017-05-03 17:48:06 +02:00
Mark Paluch
78bfd771b1 DATACOUCH-304 - Remove support for JodaTime's deprecated DateMidnight.
Related ticket: DATACMNS-1014.
2017-05-03 10:08:07 +02:00
Subhashni Balakrishnan
fc88b82328 DATACOUCH-147 - Allow to convert Date to ISO-8601 compliant strings
instead of long

Using the system property
org.springframework.data.couchbase.useISOStringConverterForDate the
conversion can be enabled so this doesn't break backward compatibility

Original pull request: #143.
2017-05-01 14:11:55 -07:00
Mark Paluch
e273152013 DATACOUCH-293 - Adopt SimpleReactiveCouchbaseRepository.findOne(…) to Reactor 3.1.
Adapt to API changes, missed this one in the previous change.

Related ticket: spring-projects/spring-data-build#333
2017-04-26 17:14:17 +02:00
Mark Paluch
19f7597dc0 DATACOUCH-302 - Adapt to moved CustomConversions to Spring Data Commons.
Introduce CassandraCustomConversions extending o.s.d.convert.CustomConversions.

Remove o.s.d.couchbase.core.convert.CouchbaseCustomConversions implementation and utility classes, extend CouchbaseCustomConversions. Replace references to o.s.d.c.c.c.CustomConversions with o.s.d.convert.CustomConversions. Adapt tests and MappingCouchbaseConverter to CouchbaseCustomConversions.

Related ticket: DATACMNS-1035.
2017-04-24 10:20:32 +02:00
Subhashni Balakrishnan
069ceea65c DATACOUCH-275 Key auto generation using Attributes, UUID
Original pull request: #142.
2017-04-12 14:38:21 -07:00
Mark Paluch
766e4eeebd DATACOUCH-293 - Polishing.
Replace references to Assert single-arg methods with references to methods accepting the test object and message.
2017-04-12 15:04:01 +02:00
Mark Paluch
3ecc2cf6cb DATACOUCH-293 - Adapt to API changes in Reactor 3.1.
Related ticket: spring-projects/spring-data-build#333
2017-04-12 15:02:54 +02:00
Subhashni Balakrishnan
03bb6372c7 DATACOUCH-276 Dont escape the order by property as a whole
Escape each nested level and concatenate with a period

Original pull request: #141.
2017-04-11 16:17:13 -07:00
Subhashni Balakrishnan
620586af3b DATACOUCH-90 Polishing
Add modified couchbase specific jsr310 converters which converts to
number formats instead of date objects which cannot be handled by the
client.

Original pull request: #139.
2017-04-11 16:17:13 -07:00
Subhashni Balakrishnan
de4e02cedb DATACOUCH-90 - Add commons Jsr310 converters to support Java 8 date/time
Original pull request: #139.
2017-04-10 11:50:15 -07:00
Subhashni Balakrishnan
4cca923c59 DATACOUCH-290 - Upgrade to java-client 2.4.4
Original pull request: #136.
2017-04-10 11:33:02 -07:00
Alexander Derkach
6429dca5e6 DATACOUCH-287 - Add CAS operations to RxJavaCouchbaseOperations.
Original pull request: #135.
2017-04-06 06:57:53 -07:00
Mark Paluch
dc0f552841 DATACOUCH-289 - Adapt to API changes in RepositoryConfigurationExtensionSupport. 2017-03-27 09:41:19 +02:00
Mark Paluch
439ab14131 DATACOUCH-273 - Adapt to API changes in Spring Data Commons. 2017-03-24 09:57:13 +01:00
Mark Paluch
141dbefd3d DATACOUCH-273 - Integrate Data Commons Java 8 upgrade branch.
Replace PersistentEntity.doWithProperties(…) and .doWithAssociations(…) with stream processing using PersistentEntity.getPersistentProperties() and PersistentEntity.getAssociations().
2017-03-24 09:57:13 +01:00
Subhashni Balakrishnan
1c33ccc4c8 DATACOUCH-279 - Re-add AbstractCouchbaseDataConfiguration
Motivation
----------
AbstractCouchbaseDataConfiguration was removed and
AbstractCouchbaseConfiguration was made the only configuration support
which implemented CouchbaseConfigurer. This broke integration with
Spring boot as they used CouchbaseConfigurer to auto configure client
initialization properties.

Changes
-------
Bring back support for AbstractCouchbaseDataConfiguration which allows the use
of CouchbaseConfigurer. Also added a similar configuration support for reactive
data repositories. Common beans between reactive and blocking are implemented
in CouchbaseConfigurationSupport class. The existing tests in
AbstractCouchbaseDataConfigurationTest does test this scenario. However the
previous commit had also changed the test because of the unawareness of spring
boot integration.

Results
-------
It is now possible to configure SDC with CouchbaseConfigurer instead of
only having to extend from AbstractCouchbaseConfiguration.
2017-02-07 10:15:00 +01:00
Subhashni Balakrishnan
5d36ecc12b DATACOUCH-265 - Support pageable and sort for String based SpEL queries
Original pull request: #128.
2017-02-05 13:08:38 -08:00
Subhashni Balakrishnan
162d8124ab DATACOUCH-260 - Update to 2.4.1 and fix tests
Adapted changes to 3.0 branch

Original pull request: #131.
2017-02-05 13:08:38 -08:00
Subhashni Balakrishnan
d9510dc158 DATACOUCH-146 - Use only last emission to create a Mono for delete collection
Original pull request: #130.
2017-02-05 10:35:11 -08:00
Subhashni Balakrishnan
d62f4bbe8c DATACOUCH-146 - Reactive repositories support
- Adds experimental support for reactor types in reactive CRUD and Sorting
  repositories using RxJava1Template
- Refactor configuration and query classes to be reusable by reactive repositories

Original pull request: #130.
2017-02-05 10:34:57 -08:00
Mark Paluch
56b3842ac1 DATACOUCH-274 - Remove references to Assert single-arg methods.
Replace references to Assert single-arg methods with references to methods accepting the test object and message.

Related ticket: SPR-15196.
2017-02-01 13:14:35 +01:00
Subhashni Balakrishnan
b52dee3a3c DATACOUCH-251 - Wrap base where criteria with parenthesis for OR expressions.
Base criteria for the query should be wrapped before adding the entity filter criteria so the priority of filtering is clear.
2016-12-20 10:57:47 +01:00