Commit Graph

305 Commits

Author SHA1 Message Date
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
Oliver Gierke
90839ef604 DATACOUCH-205 - Updated changelog. 2016-02-23 14:32:49 +01:00
Simon Baslé
056a04a030 DATACOUCH-207 - Fix integration test, wrong bean constant used 2016-02-22 16:53:53 +01:00
Simon Baslé
338eb38f46 DATACOUCH-207 - Makes all BeanNames constants public 2016-02-22 16:00:01 +01:00
Simon Baslé
2f251e0ba9 DATACOUCH-209 - Change default Consistency to READ_YOUR_OWN_WRITES
Formerly UPDATE_AFTER, but the inconsistent view this would give eg. while writing tests or exploring Spring Data Couchbase was confusing to users.
2016-02-22 15:42:40 +01:00
Simon Baslé
0007c448d6 DATACOUCH-77 - Update README links 2016-02-22 15:00:46 +01:00
Oliver Gierke
6b69b34632 DATACOUCH-195 - After release cleanups. 2016-02-12 15:43:57 +01:00
Oliver Gierke
42a962c145 DATACOUCH-195 - Prepare next development iteration. 2016-02-12 15:43:39 +01:00
Oliver Gierke
1edcafd2b0 DATACOUCH-195 - Release version 2.1 M1 (Hopper). 2016-02-12 15:42:47 +01:00
Oliver Gierke
36533c4ad3 DATACOUCH-195 - Prepare 2.1 M1 (Hopper). 2016-02-12 15:36:20 +01:00
Oliver Gierke
3676f3ef66 DATACOUCH-195 - Updated changelog. 2016-02-12 15:36:17 +01:00
Oliver Gierke
0e99d84fe2 DATACOUCH-195 - Declare Artifactory Maven plugin to be able to distribute build artifacts. 2016-02-10 14:36:34 +01:00
Oliver Gierke
b8fd9db0a1 DATACOUCH-198 - Added code of conduct.
Added CONTRIBUTING file along the way.
2016-02-08 17:11:50 +01:00
Oliver Gierke
cdf94f45c5 DATACOUCH-202 - Adapted to new API in QueryMethod and QueryLookupStrategy. 2016-02-08 17:10:13 +01:00
Oliver Gierke
73c5d0ca55 DATACOUCH-201 - Prepare next development iteration (Hopper). 2016-02-08 17:01:56 +01:00
Spring Buildmaster
f8d46ef5ca DATACOUCH-201 - Prepare next development iteration. 2016-02-08 07:17:27 -08:00
Spring Buildmaster
6f7abe4d0c DATACOUCH-201 - Release version 2.0.0.RELEASE. 2016-02-08 07:17:27 -08:00
Oliver Gierke
4e40e3d327 DATACOUCH-201 - Prepare 2.0 GA release. 2016-02-08 16:29:32 +01:00
Oliver Gierke
f66c771b87 DATACOUCH-201 - Update changelog. 2016-02-08 16:27:09 +01:00
Simon Baslé
0095313342 DATACOUCH-199 - Make automatic index creation opt-in
In addition to annotating the repository with xxxIndexed annotations, user must now opt-in to the feature by redefining the indexManager bean in the configuration. This is so production use of this feature is actively discouraged.
2016-02-05 18:08:05 +01:00
Simon Baslé
6d747e97f5 DATACOUCH-180 - Allow named parameters in inline N1QL queries
Choice of placeholder "mode" is determined by the syntax used inside the query, early during repository instantiation.

An IllegalArgumentException is thrown if both named and positional parameters are used.
2016-02-02 15:23:53 +01:00
Simon Baslé
524e8202f6 DATACOUCH-196 - Fix ViewIndexed generated map and improve usability
The generated view's default map function now emits meta.id so that CRUD findAll(ids) works.

The default value for the view name is now "all".

The ViewIndexed isn't documented as applicable to METHODs (deferred feature).
2016-01-29 17:20:57 +01:00
Simon Baslé
933ff0feaa DATACOUCH-192 - Prefix all bean names with "couchbase" 2016-01-27 15:38:14 +01:00
Simon Baslé
8f5e9e3df8 DATACOUCH-187 - Allow counting queries and single projections.
This change allows simple projections to types long, boolean, String when an inline N1QL query uses an aggregation function like AVG, COUNT.

The projection's result must be a single row with a single key/value pair in the N1QL response. Only the value gets returned.
2016-01-27 12:23:16 +01:00
Simon Baslé
721bdede2a DATACOUCH-188 - Bump SDK version to 2.2.3 2016-01-18 18:33:30 +01:00
Simon Baslé
6876e179f3 DATACOUCH-190 - Document SpEL support example. 2016-01-18 18:30:59 +01:00
Simon Baslé
15d0d27d71 DATACOUCH-189 - Test and document how to change repo implementation
Added an integration test for custom method customization.
Moved the integration test for base class customization.
Put the samples in the documentation in a new "Changing Repository Behaviour" section.
2016-01-18 18:29:03 +01:00
Simon Baslé
c589a13699 DATACOUCH-186 - Index-backed methods safe from deleted stales
This commit ensures that methods in the template and the repository base classes are correctly ignoring documents that have been deleted but are still identified by the view due to using weak consistency (Stale.TRUE).

FindByView in template now ignores null rows in its result list. It also correctly forces the includeDocs parameter in order not to risk a bad transcoding of the document (javadoc clarified).

DeleteAll in the repository CRUD implementation will correctly detect attempts at deleting a non-existing document (DocumentDoesNotExistException is also correctly mapped to a Spring Data exception now).

DeleteAll behavior with DataRetrievalFailureException is tested in RepositoryIndexUsageTest.
2016-01-18 18:24:50 +01:00
Simon Baslé
d81dc9aacc DATACOUCH-185 - view-based CRUD methods use default consistency
The CRUD methods that are backed by a view in SimpleCouchbaseRepository now take the default view consistency into account.
This includes findAll(), findAll(keys), count() and deleteAll().

PagingAndSortingRepository findAll methods already took the default N1QL consistency into account.

This is verified in an unit test and has been made more explicit in the repository documentation.
2016-01-08 16:21:20 +01:00
Simon Baslé
a1955a0af5 DATACOUCH-184 - Fix support for defining repository base class
This fixes the fact that EnableCouchbaseRepository(repositoryBaseClass = Something.class) was ignored.

Now using reflection to choose the target implementation. Note that custom base classes MUST extend SimpleCouchbaseRepository (or its subclass N1qlCouchbaseRepository).

An example in the form of an integration test has been added in src/integration/java/org/springframework/data/couchbase/repository/base/RepositoryBaseTest.java.
2016-01-07 18:16:14 +01:00
Spring Buildmaster
13b51b13bd DATACOUCH-183 - Prepare next development iteration. 2015-12-22 05:10:20 -08:00
Spring Buildmaster
18473e5aab DATACOUCH-183 - Release version 2.0.0.RC1. 2015-12-22 05:10:20 -08:00
Oliver Gierke
c8fcf5221c DATACOUCH-183 - Prepare 2.0.0.RC1.
Updated to released parent and switched to milestone repository. Removed Jackson property as it's listed in the parent pom already.
2015-12-22 14:07:09 +01:00
Oliver Gierke
73d75f7e83 DATACOUCH-183 - Updated changelog. 2015-12-22 12:49:53 +01:00
Simon Baslé
ee57c99f76 DATACOUCH-183 - Bump Jackson and Spring Data Commons versions
Jackson 2.6.0 -> 2.6.2 (which is also the version of Jackson embedded in Couchbase SDK 2.2.2)

Spring Data Commons 1.11.0.BUILD-SNAPSHOT -> 1.11.2.RELEASE
2015-12-22 12:43:26 +01:00
Oliver Gierke
0d63f7608c DATACOUCH-182 - Updated changelog. 2015-12-18 11:24:41 +01:00
Simon Baslé
8a2903b4f8 Fix paragraph depths in repository doc 2015-12-16 13:38:32 +01:00
Simon Baslé
cbe77e5fd4 DATACOUCH-177 - Upgrade SDK dependency to 2.2.2 2015-12-01 11:19:41 +01:00
Simon Baslé
aa3f9c380b DATACOUCH-176 - Geo false positive autoelimination
So far with geo queries a bounding box approximation was performed on Circle and Polygon queries (since Couchbase internally only supports Bounding Box queries).

It was confusing since in previous iteration it was up to the user to remove these false positives "after the fact" in code calling the repository.

This change allows for the framework to retain enough information to perform false positives elimination automatically and transparently for the user.
2015-12-01 11:02:08 +01:00
Simon Baslé
b78ed124ec DATACOUCH-173 - Add cleanup on some integration tests 2015-11-16 16:34:57 +01:00
Simon Baslé
2378e7145b DATACOUCH-166 - Improve SpEL support, prefix is now #{ 2015-11-16 14:15:50 +01:00
Simon Baslé
2f68740247 DATACOUCH-161 - Improve multitemplate mapping configuration
The configuration step made it look like a new mapping was necessary in overrides, whereas it is actually possible and clearer to mutate the base mapping.

Added a convenience method to get the MappingContext from the repository mapping.
2015-11-16 14:08:33 +01:00
Simon Baslé
95ea97244a DATACOUCH-172 - Fix PagingAndSorting consistency
Default consistency from template wasn't used in PagingAndSorting findAll methods.
2015-11-16 14:02:36 +01:00
Simon Baslé
40d131aab0 DATACOUCH-169 - Automatic index creation
Main indexes (ie indexes that can be used by repositories to retrieve ALL the documents of a particular entity type) are covered.

Repository interfaces can be annotated with an annotation for each type of main index that can be automatically created.

The IndexManager is responsible for creating said indexes (potentially skipping creation if an index is already in place, or if the IndexManager has been configured to skip it, see constructor).
Since IndexManager is created as a bean (either in JavaConfig or xml), there can be a different instance eg. in Prod vs Dev.

Added doc and integration test.

Renamed package core.view to core.query since it now contains various non-view related annotations and classes.
2015-11-16 13:57:38 +01:00
Simon Baslé
8ed7d7e336 DATACOUCH-174 - Fix declaration of repositories in xml 2015-11-16 10:02:33 +01:00