Commit Graph

144 Commits

Author SHA1 Message Date
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
Oliver Gierke
ce8dd97d66 DATACOUCH-262 - Adapt API in CouchbaseRepositoryFactoryBean.
Related ticket: DATACMNS-891.
2016-12-15 16:21:27 +01:00
Oliver Gierke
610a6e51d2 DATACOUCH-246 - Polishing.
Removed the dynamic return type obtained from the ResultProcessor held in a query implementation field as this breaks thread safety. We now hand the type to read into the execution methods.

Adapted test cases accordingly and removed a bit of mocking.

Original pull request: #122.
2016-12-02 18:04:15 +01:00
Subhashni Balakrishnan
ce356f827f DATACOUCH-246 - Projections support for query derivation.
Used the result processor projecting information to just fetch the selected fields and again to post process results to projection object/interfaces.

Added test for projection using DTO.

Original pull request: #122.
2016-12-02 18:04:12 +01:00
Young-Gu Chae
73f86a70ec DATACOUCH-243 - CouchbaseTemplate.doRemove() handle exceptions like doPersist() 2016-08-29 10:11:28 +02:00
Andrey Rubtsov
341c41250d DATACOUCH-239 - Allow configurable expiry in @Document.
Fixes #120
2016-08-18 13:21:14 +02:00
markramach
f18f61e371 DATACOUCH-237 - Prevent groupby on generated count queries
Fixes #119
2016-07-07 11:05:51 +02:00
Simon Bland
a40919ef8e DATACOUCH-235 - Fixed multiple Couchbase environments.
Defining <couchbase:env/> in XML configuration was causing a double
instantiation of DefaultCoreEnvironment, with subsequent warning in
logs:

[main] WARN c.c.client.core.env.CoreEnvironment - More than 1 Couchbase
Environments found (2), this can have severe impact on performance and
stability. Reuse environments!
2016-06-17 15:57:51 +02:00
Simon Baslé
d6b63c305a DATACOUCH-227 - Keep isOrderRetained view param, bump to SDK 2.2.8 2016-06-13 16:28:50 +02:00
Simon Baslé
b5ae111787 DATACOUCH-229 - Check N1QL error codes rather than message
This should avoid problems when the message changes on the server side
(like in Couchbase Server 4.5).
2016-05-25 19:17:32 +02:00
Simon Baslé
3abefe5882 DATACOUCH-228 - Make findByView use async client internally
This brings better performance when querying large views. Instead of
looping on a synchronously acquired list of documents to produce a list
of entities, the async API can be used internally to:
 - query the view
 - fetch the documents
 - map each document to an entity
 - collect into a List

One can then block on that Observable to get and return the List as
usual.
2016-05-25 18:26:02 +02:00
Geoffrey Mina
7a57a235d8 DATACOUCH-226 - Enable strict @Field mapping
If the MappingCouchbaseConverter strict mode is enabled and no annotation is present, the property will not be eligible for document mapping.

This allows to specifically ignore some attributes in Couchbase only. For generally ignoring attributes in any Spring Data backing store, prefer the standard `@Transient`.

Closes #112
2016-05-20 17:52:41 +02:00
Anastasiia Smirnova
811c024041 DATACOUCH-224 - Improve concurrent save/insert, optimistic locking 2016-05-10 15:48:34 +02:00
Jonathan Edwards
117f0d0968 DATACOUCH 225 - Minimal SDK 2.2.6 support 2016-05-09 09:31:23 -06:00
Mark Paluch
db4c24d9f1 DATACOUCH-203 - Use Set to store qualifiers in CDI extension.
Qualifiers are now stored in their original set instead of using the toString representation.
2016-03-15 14:13:14 +01:00
Simon Baslé
4aa823722a DATACOUCH-212 - Take Version/CAS into account on save
This change takes the `Version` annotated field into account when performing a `save` (either in the `CouchbaseTemplate` or transitively in a `CouchbaseRepository`).

Having such a field with a non-zero value means that a CAS is available, activating optimistic locking. Version 1.4 and below of Spring Data Couchbase was taking this CAS into account, whereas in 2.0 we switched to using `upsert` internally, which ignores the CAS.

This change brings the behavior of `save` (when there's a non-zero CAS) closer to what was observed in 1.4 versions: an `OptimisticLockingFailureException` can now be raised in case of CAS mismatch.
2016-03-14 20:00:16 +01:00
Simon Baslé
39fb52d2a6 DATACOUCH-91 - Support auditing (via java config)
This commit adds support for auditing via the use of the four annotations (CreatedBy, LastModifiedBy, CreationDate, LastModificationDate), enabled via the EnableCouchbaseAuditing annotation.

As couchbase entities MUST have an id, the only case where the creation event can be detected is when the entity has a Version annotated field.
2016-03-11 15:35:35 +01:00
Simon Baslé
dea461458b DATACOUCH-215 - Separate SDK/SDC beans in javaconfig
This commit allows to separate creation of beans dedicated to Spring Data Couchbase from the ones that can be made more common (SDK instances) and now can be provided externally through a a strategy interface, `CouchbaseConfigurer`.

Rather than having to extend a few methods from the base Configuration
class, `CouchbaseConfigurer` represents all the components that the Spring Data integration requires.
2016-03-11 10:58:38 +01:00
James Thomson
8357122950 DATACOUCH-211 - Applying sort that's passed in via the Pagenate object in call to N1qlCouchbaseRepository::findAll 2016-03-10 21:31:23 +00:00
James Thomson
0149144bc0 DATACOUCH-214 - Adding case insensitive sorting
Closes #105
2016-03-10 22:10:47 +01:00
Simon Baslé
ee58b4d6e4 DATACOUCH-216 - Add template getter on repository interface 2016-03-10 12:13:55 +01:00
Simon Baslé
67373e501e DATACOUCH-204 - Add package-info on all packages 2016-02-23 16:25:07 +01:00
Andrzej Wisłowski
40e4212ad7 DATACOUCH-59 - Allow expiry touch on read
Configuration is based on Document annotation. When read of document takes place then touch action is executed on document. It is an asynchronous action so it does not block read. It is executed only on single reads (not view-based or N1QL-based ones).
2016-02-23 14:51:27 +01:00
Simon Baslé
338eb38f46 DATACOUCH-207 - Makes all BeanNames constants public 2016-02-22 16:00:01 +01:00