Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FMWK-43 Projections (The ability to fetch only required fields from Aerospike) #415

Merged
merged 23 commits into from
Oct 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
15f2bce
Support projections in findById.
roimenashe Sep 5, 2022
a554d75
1. Fix javadoc.
roimenashe Sep 5, 2022
8940834
Support projections in Reactive Aerospike Template findById().
roimenashe Sep 5, 2022
8e7e6d5
Support projections in findByIds() methods for both Reactive Aerospik…
roimenashe Sep 6, 2022
51183cf
Support projections in findBy queries methods for Non-Reactive Aerosp…
roimenashe Sep 6, 2022
0b163af
1. Change internal param order.
roimenashe Sep 6, 2022
84ca6b5
Remove redundant internal policy param.
roimenashe Sep 6, 2022
45c7335
Add back the policy param and pass as null for now.
roimenashe Sep 6, 2022
d48f985
Add private to relevant method.
roimenashe Sep 6, 2022
4f4d14c
Support projections in findBy queries methods for Reactive Aerospike …
roimenashe Sep 6, 2022
a234552
findById fix, construct binNames only in case targetClass is passed.
roimenashe Sep 6, 2022
50c0546
Support repository queries projection.
roimenashe Sep 6, 2022
aaebee8
Support repository projections in reactive repositories.
roimenashe Sep 6, 2022
93414f6
Add few more repository projections tests (reactive and non-reactive).
roimenashe Sep 7, 2022
399c123
Fix reactive repository projection test.
roimenashe Sep 7, 2022
e530986
AerospikeTemplate refactor, unify projection internal methods with no…
roimenashe Sep 7, 2022
dc0b271
Dynamic projection support for reactive and non-reactive repositories.
roimenashe Sep 7, 2022
fc4b35c
Remove duplicate code.
roimenashe Sep 7, 2022
cfc58fc
Use boolean hasDynamicProjection() instead of findDynamicProjection().
roimenashe Sep 7, 2022
a40f2de
Use @Data instead of getter, setter, equalsAndHashCode and ToString.
roimenashe Sep 7, 2022
36dd4f5
Add @Document annotation to persistence entities in tests.
roimenashe Sep 8, 2022
a194313
Merge remote-tracking branch 'origin/main' into feature/projections
roimenashe Oct 12, 2022
c3c6ab8
Rename record to aeroRecord.
roimenashe Oct 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@ public interface AerospikeOperations {
*/
<T> Stream<T> find(Query query, Class<T> entityClass);

/**
* Find documents in the given entityClass's set using a query and map them to the given target class type.
*
* @param query The query to filter results. Must not be {@literal null}.
* @param entityClass The class to extract the Aerospike set from. Must not be {@literal null}.
* @param targetClass The class to map the document to. Must not be {@literal null}.
* @return A Stream of matching documents, returned documents will be mapped to targetClass's type.
*/
<T, S> Stream<S> find(Query query, Class<T> entityClass, Class<S> targetClass);

/**
* Find all documents in the given entityClass's set and map them to the given class type.
*
Expand All @@ -176,6 +186,15 @@ public interface AerospikeOperations {
*/
<T> Stream<T> findAll(Class<T> entityClass);

/**
* Find all documents in the given entityClass's set and map them to the given target class type.
*
* @param entityClass The class to extract the Aerospike set from. Must not be {@literal null}.
* @param targetClass The class to map the document to. Must not be {@literal null}.
* @return A Stream of matching documents, returned documents will be mapped to targetClass's type.
*/
<T, S> Stream<S> findAll(Class<T> entityClass, Class<S> targetClass);

/**
* Find a document by id, set name will be determined by the given entityClass.
* <p>
Expand All @@ -187,6 +206,18 @@ public interface AerospikeOperations {
*/
<T> T findById(Object id, Class<T> entityClass);

/**
* Find a document by id, set name will be determined by the given entityClass.
* <p>
* Document will be mapped to the given entityClass.
*
* @param id The id of the document to find. Must not be {@literal null}.
* @param entityClass The class to extract the Aerospike set from. Must not be {@literal null}.
* @param targetClass The class to map the document to. Must not be {@literal null}.
* @return The document from Aerospike, returned document will be mapped to targetClass's type, if document doesn't exist return null.
*/
<T, S> S findById(Object id, Class<T> entityClass, Class<S> targetClass);

/**
* Find documents by providing multiple ids using a single batch read operation, set name will be determined by the given entityClass.
* <p>
Expand All @@ -198,6 +229,18 @@ public interface AerospikeOperations {
*/
<T> List<T> findByIds(Iterable<?> ids, Class<T> entityClass);

/**
* Find documents by providing multiple ids using a single batch read operation, set name will be determined by the given entityClass.
* <p>
* Documents will be mapped to the given targetClass.
*
* @param ids The ids of the documents to find. Must not be {@literal null}.
* @param entityClass The class to extract the Aerospike set from. Must not be {@literal null}.
* @param targetClass The class to map the document to. Must not be {@literal null}.
* @return The documents from Aerospike, returned documents will be mapped to targetClass's type, if no document exists return an empty list.
*/
<T, S> List<S> findByIds(Iterable<?> ids, Class<T> entityClass, Class<S> targetClass);

/**
* Executes a single batch request to get results for several entities.
* <p>
Expand Down Expand Up @@ -296,12 +339,22 @@ public interface AerospikeOperations {
/**
* Find all documents in the given entityClass's set using a provided sort and map them to the given class type.
*
* @param entityClass The class to extract the Aerospike set from and to map the documents to.
* @param sort The sort to affect the returned iterable documents order.
* @param entityClass The class to extract the Aerospike set from and to map the documents to.
* @return An Iterable of matching documents, returned documents will be mapped to entityClass's type.
*/
<T> Iterable<T> findAll(Sort sort, Class<T> entityClass);

/**
* Find all documents in the given entityClass's set using a provided sort and map them to the given target class type.
*
* @param sort The sort to affect the returned iterable documents order.
* @param entityClass The class to extract the Aerospike set from.
* @param targetClass The class to map the document to. Must not be {@literal null}.
* @return An Iterable of matching documents, returned documents will be mapped to targetClass's type.
*/
<T, S> Iterable<S> findAll(Sort sort, Class<T> entityClass, Class<S> targetClass);

/**
* Find documents in the given entityClass's set using a range (offset, limit) and a sort
* and map them to the given class type.
Expand All @@ -314,6 +367,19 @@ public interface AerospikeOperations {
*/
<T> Stream<T> findInRange(long offset, long limit, Sort sort, Class<T> entityClass);

/**
* Find documents in the given entityClass's set using a range (offset, limit) and a sort
* and map them to the given target class type.
*
* @param offset The offset to start the range from.
* @param limit The limit of the range.
* @param sort The sort to affect the returned Stream of documents order.
* @param entityClass The class to extract the Aerospike set from. Must not be {@literal null}.
* @param targetClass The class to map the document to. Must not be {@literal null}.
* @return A Stream of matching documents, returned documents will be mapped to targetClass's type.
*/
<T, S> Stream<S> findInRange(long offset, long limit, Sort sort, Class<T> entityClass, Class<S> targetClass);

/**
* Return the amount of documents in a query results. set name will be determined by the given entityClass.
*
Expand Down
Loading