Modified applyUpdatedCas() to return accessor.getBean() which will
occur if the version property is Immutable.
Created applyUpdateId() that is analogous to applyUpdatedCas()
Factored out the equals() method that was used by a number of
test entity objects.
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
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")
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).