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
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.
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.
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.
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.
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.
We now make sure that repositories for domain types annotated with @Document or extending CouchbaseRepository are considered strict repository candidates.
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.
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.
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.
Replace PersistentEntity.doWithProperties(…) and .doWithAssociations(…) with stream processing using PersistentEntity.getPersistentProperties() and PersistentEntity.getAssociations().
- 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.
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.
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.
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!
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
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).
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.
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.
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.
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.
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.
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.
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.
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.