* DATACOUCH-588 - Implement pageable and realign repo query
This implements pageable for non-reactive queries and
realigns reactive queries with other spring-data projects
to facilitate the implementaion of pageable (done) and other
types of queries such as projection and distinct (not yet
done)
* DATACOUCH-588 - Implement pageable and realign repo query
This implements pageable for non-reactive queries and
realigns reactive queries with other spring-data projects
to facilitate the implementaion of pageable (done) and other
types of queries such as projection and distinct (not yet
done)
* DATACOUCH-588 - Refactoring part 1 of n.
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
Support document expiryExpression and make the initial expiry
to be null instead of Zero in the fluent API. This allows
a client to 'unset' the expiry from an annotation by explcitly
setting withExpiry(Zero).
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
Due to the interdependencies of beans, autoindexing does not work
in the startup of a normal spring-boot application. Processing of
entities occurs during the initialization of CouchbaseMappinContext,
which occurs before initialization of MappingCouchbaseConverter,
which occurs before the initialization of CouchbaseTemplate -
which creates the indexCreator listener. So when the
AbstractMappingContext (CouchbaseMappingContext) is publishing
MappingContextEvents - there is not yet any indexCreator.
And subsequent processing of entities finds the entities cached,
and therefore does not publish MappingContextEvents. This change
overrides the addPersistentEntity() and getPersistentEntity()
methods of AbstractMappingContext such that caching does not
preven the MappingContextEvents from being published. This change
also exposes indexCreator classesSeen map to CouchbaseMappingContext
so that once an entity has been processed by indexCreator, it is
not published again.
Autoindexing by SpringJUnitConfig did work prior to this change.
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
* DATACOUCH-550 Autoindexing only works from SpringJunitConfig
Due to the interdependency in bean creation, Autoindexing does not
work in a normal spring-boot application. This change overrides
the addPersistentEntity and getPersistentEntity of CouchbaseMappingContext
to avoid entries cached before the indexCreator was listening from
preventing MappingContextEvents from being published after the indexCreator
is listening. It also exposes the indexCreators classesSeen map so that
MappingEvents for an entity are not re-published after the indexCreator
has seen them.
* DATACOUCH-550 - Autoindexing does not work spring-boot application.
Due to the interdependencies of beans, autoindexing does not work
in the startup of a normal spring-boot application. Processing of
entities occurs during the initialization of CouchbaseMappinContext,
which occurs before initialization of MappingCouchbaseConverter,
which occurs before the initialization of CouchbaseTemplate -
which creates the indexCreator listener. So when the
AbstractMappingContext (CouchbaseMappingContext) is publishing
MappingContextEvents - there is not yet any indexCreator.
And subsequent processing of entities finds the entities cached,
and therefore does not publish MappingContextEvents. This change
overrides the addPersistentEntity() and getPersistentEntity()
methods of AbstractMappingContext such that caching does not
preven the MappingContextEvents from being published. This change
also exposes indexCreator classesSeen map to CouchbaseMappingContext
so that once an entity has been processed by indexCreator, it is
not published again.
Autoindexing by SpringJUnitConfig did work prior to this change.
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
Added interfaces for apis on core objects which are common among
many objects. For instance withExpiry and withExpirty on all the
insert/replace/upsert/remove objects. The definition of an interface
simplyfies testing of all the possible combinations - instead of having
four (or eight, counting Reactive), there is one interface to test
them all.
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
The format has changed as well. The release versions no longer have
the .RELEASE suffix - they are just the version number (i.e. 4.1.1)
And the snapshot versions have the suffix -SNAPSHOT (i.e. 4.2.0-SNAPSHOT)
instead of 4.1.0.BUILD-SNAPSHOT
Co-authored-by: mikereiche <michael.reiche@couchbase.com>
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