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.
Since the client factory is a spring data concept, it cannot be
exposed on the configurer. Only expose the cluster and the environment
on it.
This also modifies the config to populate the right beans from the
configurer methods as well.
Since boot needs it for easy mocking/testing, restoring the
configurer (but with the new corresponding beans and only
the subset that is currently available).
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.
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.
Couchbase template could get only the component type information which
works for collection properties but when the join is one-to-one for a
single generic type it would fail. The fix is use to the actual type if
the property is not a collection.
Original PR: #177.
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.
Motivation
----------
Reactive string based N1QL count query incorrectly returns the map after
the single result projection.
Changes
-------
Map the observable returning from the N1ql query result deserialized to
a map by converting to the correct return type using the conversion
service. Verified by integration tests.
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.
We now export composable repositories through our CDI extension. Repositories can now be customized either by a single custom implementation (as it was before) and by providing fragment interfaces along their fragment implementation.
This change aligns CDI support with the existing RepositoryFactory support we provide within a Spring application context.
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.