MOTIVATION
customers would like to specify a type field other than _class, and
would like to specify a type field value other than the class name
of the domain object
CHANGES
Follow the instructions at
https://stackoverflow.com/questions/38847605/how-to-use-spring-data-with-couchbase-without-class-attribute
in the test domain, supply a CustomMappingCouchbaseConvert class that leverates a
TypeBasedCouchbaseTypeMapper, which in turn uses a TypeAwareTypeInformationMapper.
The typeKey used is "t". The TypeAwareTypeInformationMapper uses the DocumentType annotation
as the value for the type map entry. The domain Person object has @DocumentType("p"), which
will result in type mapping of "t" : "p" for Person objects.
In addition, when a query is composed, the typeKey and typeValue are taken from the converter.
This reinstates the auditing that was present before the major
refactoring. Additional testing for createdBy, createdDate,
lastModifiedBy, lastModifiedDate has been added as well.
This changeset fixes an issue where while blocking repositories would
work properly, the reactive repositories won't. This has been an
oversight in the transition before RC1.
This changeset reintroduces automatic n1ql index generation but through
new annotations: QueryIndexed and CompositeQueryIndex (as well as
CompositeQueryIndexes to supply more than one). They are translated
into create index statements and executed at startup if configured
in the config.
Note that automatic index management is disabled by default but can
be overidden with a simple flag on the config override. More features
to come later.
Support for positional parameters necessitated caching them, however
that was not done in a threadsafe fashion. ThreadLocal storage is
sufficient to take care of the issue. Added test for it while at it.
After updating the POM to not have a fixed testcontainers version, we
discovered the tests were failing with later versions of testcontainers. It
seems that they updated how they did WaitStrategy, deprecating the old way, so
our WaitStrategy was not being called. That means no setup was done to
the cluster (passwords, buckets, etc...). Simple fix was to move to the
new interface.
There was an integration test which wasn't named properly, and
so it was running with regular tests. This left the container
around, and all subsequent integration tests failed. Simple
fix.
Plus a test. I didn't notice that Douglas Six did basically the
same thing in another PR (this was a re-do of an earlier PR which
didn't quite do what we'd like). So since I already had it done
and had a test, I closed that PR (#163) and added him to the author
list.
Also - repository.count() raises a NoSuchElementException after you
delete all the documents. That seems like a bug, but we will deal
with that separately.
* add @WithConsistency annotation
* evaluate it and set consistency in AbstractN1qlBasedQuery
* evaluate it and set consistency in ReactiveAbstractN1qlBasedQuery
* add documentation on @WithConsistency
Original pull request: #198.
Seems that LocalDateTime now has microseconds, so the comparison of the unconverted
and converted LocalDateTime will fail, since the conversion/mapping only retains
millisecond precision.
This change enables running the integration tests with the command:
mvn verify
Update the integration tests so they compile and pass. Rename them according
to Spring Data convention (*IntegrationTests.java) so they are executed by the
failsafe plugin instead of the surefire plugin. Move them to same folder as
unit tests according to Spring Data convention.
Update the surefire plugin configuration to include unit tests in classes
named `*Test` as well as `*Tests`. Prior to this change about half of the unit
tests were being ignored.
Integration test changes
========================
Use static factory methods for Sort and PageRequest instead of calling the
constructors which are now private.
Import EvaluationContextExtension from its new package. Remove reference to
deprecated EvaluationContextExtensionSupport.
Retry all calls to `getRepository` because otherwise they may fail due to
concurrent index creation.
Fix test `shouldDeriveViewParameters` to assume results are unordered.
Fail fast if the `server.properties` resource is missing.
Increase query and view timeouts; container is a big sluggish sometimes.
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.