Commit Graph

286 Commits

Author SHA1 Message Date
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
Oliver Gierke
10088b7077 DATACOUCH-175 - Updated changelog. 2015-11-16 08:47:39 +01:00
Simon Baslé
58d98c5f28 DATACOUCH-168 - Support and document all reduce functions
Detection whether or not reduce should be activated is now centralized. Triggers are:
  - using the count prefix instead of find in method name
  - setting reduce = true in the View annotation explicitly.

The reduce can thus be returning any kind of value (added an integration example with _stats), which is now properly documented.
2015-10-20 18:15:55 +02:00
Simon Baslé
ec129e86a8 DATACOUCH-166 - Add basic SpEL support
Added the step of parsing SpEL expressions delimited by ${ } in StringN1qlBasedQuery, then the actual evaluation of each expression.

Refactored StringN1qlBasedQuery to use SpEL across the board, including for N1QL specific placeholders (SELECT-FROM, WHERE filter, etc...).

Refactored StringN1qlBasedQuery to use local methods rather than static methods, and amended the unit tests accordingly (using mocks).

Refactored getStatement and getCountStatement so they can see the parameters passed in at runtime.

Added unit tests + integration test.

Added SpEL support example in documentation.
2015-10-20 18:06:50 +02:00
Simon Baslé
6294b03f46 DATACOUCH-165 - Fix geo integration test (bad merge multiBucket) 2015-10-16 16:53:08 +02:00
Simon Baslé
5beeaff9af DATACOUCH-170 - Fix N1QL annotation and inline querying in docs
In some places in the doc (javadoc, README, asciidoc), the annotation was still referred to as N1QL instead of Query...

Improved doc on inline statement for N1QL queries allowing the use of positional `$1` placeholders.
2015-10-15 17:28:37 +02:00
Simon Baslé
c6aa84ced4 DATACOUCH-165 - Add utilities to remove geo false positives
PointInShapeEvaluator can be used to check answers and remove false positives from answers that have been approximated (circle and polygon).

One implementations are provided, based on awt.

Hinted at the existence of the PointInShapeEvaluator in the message that warns about bounding box approximations.

Added mention of the AwtPointInShapeEvaluator in the asciidoc with code sample.
2015-10-14 16:49:51 +02:00
Simon Baslé
a2f26f4310 DATACOUCH-165 - Add geospatial support
Add support for geo queries through the use of Spatial Views. This needs the query method to be annotated with @Dimensional (or a meta-annotation of it that is runtime retained).

See SpatialViewQueryCreator javadoc for supported part types and corresponding expected arguments (to be documented).
In a nutshell WITHIN Box (other shapes supported but approximated to bounding box), NEAR Point+Distance (approximated to bounding box), plus a few simple operators for dimensions beyond 2.

When approximating, a DEBUG log is made along the logging of the query.

Conversion methods from Shapes to bounding boxes are done in a GeoUtils class.

Unit and Integration test of the feature.

Added documentation for @Dimensional query derivation.
2015-10-14 15:26:22 +02:00
Simon Baslé
2914f57897 DATACOUCH-161 - Allow repositories to use different templates
Added a configuration bean that allows to express what CouchbaseOperations each repository should use, individually or by domain type.

Added documentation for the feature in repository section.
2015-10-14 15:22:54 +02:00
Oliver Gierke
46e16d951d DATACOUCH-167 - Updated changelog. 2015-10-14 14:46:27 +02:00
Simon Baslé
e4b103cdfa DATACOUCH-158 - Allow more explicit expiry unit
The Document annotation now also support explicitly giving a TimeUnit for the expiry, ensuring the framework will correctly convert that to the expected Couchbase format.
2015-10-14 10:43:01 +02:00
Simon Baslé
7654af7608 DATACOUCH-164 - Use stable Couchbase SDK
Make modifications due to name changing in 2.2.0, the latest stable release of the Couchbase SDK.
2015-09-21 16:46:51 +02:00
Simon Baslé
f661bad73b Fix unit test compile error due to project layout
The integration part is not yet executed by automated test tools so the unit test couldn't find a Party class.
2015-09-21 15:41:15 +02:00
Simon Baslé
56ae8217e9 DATACOUCH-138 - Add Page/Slice/PagingAndSortingRepo
Add support for Page / Slice in N1QL query derived methods.
Add PagingAndSortingRepository support through a N1qlCouchbaseRepository implementation. It will only be used as a base if N1QL is actually available on the cluster.

Refactor out some steps of entity related query creation in a N1qlUtils class, so that they can be also done eg. in repository base classes.

Add tests for both N1qlUtils and the N1qlCouchbaseRepository.

Document that PagingAndSortingRepository is supported provided N1QL is available on the Couchbase cluster.
2015-09-21 15:17:53 +02:00
Simon Baslé
ef4a79efff DATACOUCH-163 - Fix integration test relative to typeKey 2015-09-16 17:20:10 -04:00
Simon Baslé
89e56d6342 DATACOUCH-159 - Improved performance of decoding of longs.
Original pull requests: #67.
Cherry-pick of e5bed8e, adapted with polishing from 6fec488.
2015-08-31 19:04:01 +02:00
Oliver Gierke
411eb1c463 DATACOUCH-150 - After release cleanups. 2015-08-05 15:05:35 +02:00
Spring Buildmaster
84197c132e DATACOUCH-150 - Prepare next development iteration. 2015-08-05 06:01:08 -07:00
Spring Buildmaster
0ca59a782d DATACOUCH-150 - Release version 2.0.0.M1. 2015-08-05 06:01:07 -07:00
Michael Nitschinger
5beb43e87e DATACOUCH-150 - Bump parent to 1.7.0.RC1 2015-08-05 14:35:54 +02:00