Commit Graph

194 Commits

Author SHA1 Message Date
Michael Nitschinger
b47fc007b5 DATACOUCH-531 - Initial javadoc polish for GA 2020-05-06 14:54:34 +02:00
Michael Nitschinger
e262a05184 DATACOUCH-519 - Apply formatting for changes 2020-05-06 10:35:04 +02:00
mikereiche
e8e13ffebc DATACOUCH-519 - Reinstate template auditing
This reinstates the auditing that was present before the major
refactoring. Additional testing for createdBy, createdDate,
lastModifiedBy, lastModifiedDate has been added as well.
2020-05-06 10:32:11 +02:00
Michael Nitschinger
af960817e9 DATACOUCH-504 - Apply eclipse formatting rules. 2020-04-19 07:21:35 +02:00
Michael Nitschinger
b1ed8941bb DATACOUCH-504 - Make sure reactive repositories can be used
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.
2020-04-19 07:14:59 +02:00
Michael Reiche
0c0dc21f8e DATACOUCH-515 implement additional operators in N1qlQueryCreator and QueryCriteria (#213)
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
2020-04-07 16:45:53 +02:00
Michael Nitschinger
ad56d48926 DATACOUCH-504 - Optimize shutdown of cluster
Only shut it down on the factory if internally initialized and
make sure we properly close it on the config.
2020-03-17 15:05:44 +01:00
Michael Nitschinger
f950e4648a DATACOUCH-504 - Reintroduce query index generation
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.
2020-03-17 15:05:41 +01:00
Michael Nitschinger
3bd9635df3 DATACOUCH-509 - remove the configurer again
Boot figured out a better way to handle it, so we can get rid of
it again.
2020-03-17 15:05:34 +01:00
Michael Nitschinger
e100042850 DATACOUCH-504 - Make sure Reactive* repository take the reactive operations. 2020-03-17 15:05:30 +01:00
Michael Nitschinger
573e389f22 DATACOUCH-509 - Align environment naming in configurer 2020-03-17 15:05:24 +01:00
Michael Nitschinger
e918fa8793 DATACOUCH-509 - couchbaseClientFactory needs to take cluster from configurer 2020-03-17 15:05:20 +01:00
Michael Nitschinger
1ee0045f0e DATACOUCH-509 - Expose only SDK related infos on configurer
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.
2020-03-17 15:05:14 +01:00
Michael Nitschinger
cf67ab44cc DATACOUCH-504 - Make couchbase cache config available.
Spring boot needs to be able to access the cache config on the
CouchbaseCache instance, so make it available.
2020-03-17 15:05:09 +01:00
Michael Nitschinger
daf479b345 DATACOUCH-509 - Restore CouchbaseConfigurer
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).
2020-03-17 15:05:05 +01:00
Michael Nitschinger
4abad35639 DATACOUCH-504 - More enhancements for spring boot 2020-03-17 15:05:01 +01:00
David Kelly
c9a19c925e DATACOUCH-504 - Migrate to Couchbase SDK 3 2020-03-17 15:04:37 +01:00
Mark Paluch
e944081b94 DATACOUCH-498 - Update copyright years to 2020. 2020-01-07 08:43:29 +01:00
David Kelly
f69d51586d DATACOUCH-484 - Thread safety issue using findBy.
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.
2019-11-13 08:37:17 -07:00
David Kelly
98a4999f37 DATACOUCH-383 - RxJavaCouchbaseTemplate should return generated id when saving.
Seems we fixed this for the non-Rx version, but not the RxJava version.  Followed
same basic strategy which was used for version, added a simple test.
2019-08-01 09:58:32 -07:00
Mark Paluch
1de7acd1eb DATACOUCH-465 - Adapt to changed API in Commons. 2019-07-26 09:25:40 +02:00
David Kelly
4341edf941 DATACOUCH-462 - ReactiveCouchbaseRepository count() will raise exception when bucket is empty.
Small cleanup in the deleteAll test (which actually tests this as well), while
we are there.

Also, removed an unused import
2019-06-28 10:21:41 -06:00
David Kelly
64a91f1eb6 DATACOUCH-356 Fix cast issue in deleteAll (#201)
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.
2019-06-26 16:37:11 -06:00
Johannes Jasper
55235b2bc2 DATACOUCH-206 - Provides a way to set distinct consistency on repository methods.
* 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.
2019-06-26 21:48:01 +02:00
Spring Operator
2f4500e9c7 DATACOUCH-439 - URL Cleanup.
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 219 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).

Original Pull Request: #195
2019-03-22 11:19:57 +01:00
Subhashni Balakrishnan
e1e4385896 DATACOUCH-438 - Move off deprecations in Spring Data Commons.
Remove stray import IsNewStrategyFactory. This has been removed from commons and causing build failure.

Related ticket: DATACMNS-1496.
2019-03-13 19:01:26 +01:00
ctayeb
97fc4a0471 DATACOUCH-432 - Fix ANSI Joins OneToOne relationships
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.
2019-02-22 12:14:04 -08:00
Subhashni Balakrishnan
2f0e255fbb DATACOUCH-415 - Improve performance by re-using the same set instance
Reuse the same instance of the set instead of recreating each time

Original PR: #176
2019-02-12 16:29:06 -08:00
Subhashni Balakrishnan
580a50b40f DATACOUCH-388 Add support for ANSI-JOIN across entities
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
2019-02-12 09:56:58 -08:00
Mark Paluch
f4116f6de6 DATACOUCH-425 - Update copyright years to 2019. 2019-01-02 12:31:10 +01:00
Subhashni Balakrishnan
c4491dc8b4 DATACOUCH-413 Use parameterized queries for Query derivation
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.
2018-11-26 11:23:14 -08:00
Subhashni Balakrishnan
9840acd2c6 DATACOUCH-384 - Apply converters to string based query parameters
Apply the converters registered to serialize the positional and named
parameters to match the database representation

Original Pull Request: #172.
2018-11-07 14:39:11 -08:00
Subhashni Balakrishnan
5af4dae334 DATACOUCH-401 Fix incorrect return type for reactive string based N1ql count query
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.
2018-09-20 23:06:36 -07:00
Subhashni Balakrishnan
5fbfd78220 DATACOUCH-386 Improve javadoc for setWriteResultChecking 2018-09-20 22:45:59 -07:00
Subhashni Balakrishnan
e360c23d92 DATACOUCH-376 - Apply custom conversions for collection elements
Original Pull Request: #164.
2018-07-16 11:10:43 -07:00
Subhashni Balakrishnan
076dcc0219 DATACOUCH-389 - Update to Couchbase-Java-Client 2.6.0
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.
2018-07-16 10:25:56 -07:00
Oliver Gierke
ed6820e3a4 DATACOUCH-390 - Adapt API changes for immutable entity support.
Related tickets: DATACMNS-1322.
2018-07-12 16:26:03 +02:00
Oliver Gierke
3713181083 DATACOUCH-379 - Adapt to SpEL extension API changes in Spring Data Commons.
Related tickets: DATACMNS-1260.
2018-05-15 10:00:45 +02:00
Oliver Gierke
b18761b409 DATACOUCH-373 - Adapt to API changes in Spring Data Commons.
Related tickets: DATACMNS-1275.
2018-04-09 14:56:27 +02:00
Mark Paluch
a46f8160a9 DATACOUCH-368 - Export composable repositories via CDI.
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.
2018-03-12 16:55:30 +01:00
Subhashni Balakrishnan
0960f11a9c DATACOUCH-322 - Add RBAC username and password support
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.
2018-03-07 15:09:15 -08:00
Subhashni Balakrishnan
039e106032 DATACOUCH-362 - Use dynamic proxying
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.
2018-03-07 13:26:55 -08:00
Mark Paluch
e8c647fb9d DATACOUCH-350 - Polishing.
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.
2017-11-25 11:08:51 +01:00
Alex Derkach
322642515a DATACOUCH-350 - Consider repository type in configuration extensions.
We now check in configuration extensions whether the extension is capable to implement the repository by considering whether a repository is a reactive one. This prevents the non-reactive extension from implementing reactive repositories and vice versa.

Original pull request: #153.
2017-11-25 11:07:13 +01:00
Ben Benoit
4908749bcd DATACOUCH-328 - Fix document expiry when using expressions
When using an expiry expression with TimeUnit.DAYS larger than 30 days
the document expiry is not correctly set.

Original pull request: #150.
2017-10-17 11:34:12 -07:00
Oliver Gierke
5f24502175 DATACOUCH-330 - Improved detectability of Couchbase repositories in strict configuration mode.
We now make sure that repositories for domain types annotated with @Document or extending CouchbaseRepository are considered strict repository candidates.
2017-08-28 11:24:48 +02:00
MLabusquiere
761c08517b DATACOUCH-329 - Save repo return with the generated id
Original pull request: #151.
2017-08-24 13:49:00 -07:00
Mark Paluch
9218b09f26 DATACOUCH-320 - Adapt to API changes in mapping subsystem. 2017-07-04 14:37:18 +02:00
Christoph Strobl
0786cda78d DATACOUCH-314 - Adopt to ReactiveCrudRepository.deleteById(Publisher).
Related ticket: DATACMNS-1063.

Original Pull Request: #147
2017-06-13 19:56:55 +02:00
Mark Paluch
55832cfa21 DATACOUCH-314 - Adopt to ReactiveCrudRepository.findById(Publisher) and existsById(Publisher).
Related ticket: DATACMNS-1063.

Original Pull Request: #147
2017-06-13 19:56:15 +02:00