The version arg - which is not in the document - will be passed
into the constructor as a null which will fail if it is a primitive
type. This change will pre-populated the converted object with
the version/cas, so that it is not null.
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
The complete property path was being quoted instead of the individual
components. ie. `address.street` instead of `address`.`street`
Also fixed another issue - changed the maybeQuote() method for
property names to correctly look for back-tics instead of double
quotes and changed the name accordingly.
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
For IN and NOT_IN - they can take varargs, an array or a JsonArray
Don't cast query criteria parameters, let parameter accessor handle that.
Fixed conversion of query criteria values to parameters
Cleaned up QueryCriteria
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
For a query as below that has conditional portions, the parsing for
parameters was being done before the conditional portions were being
resolved, which left the parameters between quotes where they wre
not being recognized as query parameters.
@Query("#{#n1ql.selectEntity} WHERE #{#n1ql.filter} " +
" #{#projectIds != null ? 'AND iata IN $1' : ''} ")
Long count(@Param("projectIds") List<String> projectIds)
* DATACOUCH-615 Use query in removeByQuery
Use provided query instead of hardcoded statement.
* DATACOUCH-615 Better method naming in Query class
* DATACOUCH-615 Replace hard-coded meta fields
* DATACOUCH-615 Test findByQuery.matching
* DATACOUCH-615 Remove failing test
Since it is difficult to determine where the n1ql.filter (which typically
filters on _class), and also because it is not mandator, including
the n1ql.filter in the @query is left up to the author of the query.
Example:
@query("#{#n1ql.selectEntity} where #{#n1ql.filter} and lastname = $1")
Some of the tests that run as UNMANAGED and pass when ran from intellij were
failing when ran from the command-line mvn, or when ran together will other tests.
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.