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.
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.
In the SimpleCouchbaseRepository the guessed design document was lowercase of the entity class, whereas in ViewBasedCouchbaseQuery it is uncapitalized (only first letter is lowercase).
This has been made consistent, using the uncapitalize method. The doc now reflects that and explicitly have examples with camel case classes (UserInfo instead of User).
The documentation has been updated to reflect the changes in the new Spring Data Couchbase 2.0.
A simple list of major changes to take into account when migrating from 1.x to 2.x has been added.
README.md has also been updated.
Adaptation were made to use SDK 2.0:
- Reworked the configuration approach (more parts to be configured, like Environment, Cluster and Bucket)
- Added a new xml schema for configuration of 2.0 version
- Adapted the template
- Added N1QL support in the template (findByN1QL)
- Removed the cache package
- Adapted the repository
- Better separated Unit Tests from Integration Tests
All integration and unit tests pass, except one (SimpleCouchbaseRepositoryTests.shouldFindCustom).
Customisation of a ViewQuery will be addressed in another ticket.
This changeset is a complete refactor of the mapping layer to make
sure that _class complex type mapping works. It also decouples
the actual JSON mapping and abstracts it into a CouchbaseDocument
mapping. This ensures forward compatibility by potentially swapping
out JSON to a different format.