diff --git a/src/main/java/org/springframework/data/aerospike/core/ReactiveAerospikeOperations.java b/src/main/java/org/springframework/data/aerospike/core/ReactiveAerospikeOperations.java index ed78860ff..3b69c2901 100644 --- a/src/main/java/org/springframework/data/aerospike/core/ReactiveAerospikeOperations.java +++ b/src/main/java/org/springframework/data/aerospike/core/ReactiveAerospikeOperations.java @@ -22,8 +22,6 @@ import com.aerospike.client.reactor.IAerospikeReactorClient; import org.springframework.data.aerospike.core.model.GroupedEntities; import org.springframework.data.aerospike.core.model.GroupedKeys; -import org.springframework.data.aerospike.query.FilterOperation; -import org.springframework.data.aerospike.repository.query.CriteriaDefinition; import org.springframework.data.aerospike.repository.query.Query; import org.springframework.data.domain.Sort; import org.springframework.data.mapping.context.MappingContext; @@ -519,15 +517,4 @@ Mono createIndex(Class entityClass, String indexName, String binNam * @return true if exists. */ Mono indexExists(String indexName); - - /** - * Find entities that have the given metadata field with the operation applied to its value. - * - * @param metadataFieldName Metadata field name. - * @param operation Operation to be applied. - * @param value Numerical value of the metadata field. - * @return Entities that satisfy the applied operation - */ - Flux findByMetadata(CriteriaDefinition.AerospikeMetadata metadataFieldName, FilterOperation operation, - long value, Class entityClass); } diff --git a/src/main/java/org/springframework/data/aerospike/core/ReactiveAerospikeTemplate.java b/src/main/java/org/springframework/data/aerospike/core/ReactiveAerospikeTemplate.java index 9a0891395..e4ef0c107 100644 --- a/src/main/java/org/springframework/data/aerospike/core/ReactiveAerospikeTemplate.java +++ b/src/main/java/org/springframework/data/aerospike/core/ReactiveAerospikeTemplate.java @@ -37,12 +37,9 @@ import org.springframework.data.aerospike.mapping.AerospikeMappingContext; import org.springframework.data.aerospike.mapping.AerospikePersistentEntity; import org.springframework.data.aerospike.mapping.AerospikePersistentProperty; -import org.springframework.data.aerospike.query.FilterOperation; import org.springframework.data.aerospike.query.Qualifier; import org.springframework.data.aerospike.query.ReactorQueryEngine; import org.springframework.data.aerospike.query.cache.ReactorIndexRefresher; -import org.springframework.data.aerospike.repository.query.AerospikeCriteria; -import org.springframework.data.aerospike.repository.query.CriteriaDefinition; import org.springframework.data.aerospike.repository.query.Query; import org.springframework.data.aerospike.utility.Utils; import org.springframework.data.domain.Sort; @@ -831,17 +828,6 @@ public Mono indexExists(String indexName) { return Mono.just(false); } - @Override - public Flux findByMetadata(CriteriaDefinition.AerospikeMetadata metadataFieldName, FilterOperation operation, long value, Class entityClass) { - AerospikeCriteria criteria = new AerospikeCriteria(new Qualifier.QualifierBuilder() - .setMetadataField(metadataFieldName) - .setFilterOperation(operation) - .setValue1(Value.get(value))); - Query query = new Query(criteria); - - return find(query, entityClass); - } - @Override public IAerospikeReactorClient getAerospikeReactorClient() { return reactorClient; diff --git a/src/main/java/org/springframework/data/aerospike/query/FilterOperation.java b/src/main/java/org/springframework/data/aerospike/query/FilterOperation.java index 8a8e3faa5..a61e049b7 100644 --- a/src/main/java/org/springframework/data/aerospike/query/FilterOperation.java +++ b/src/main/java/org/springframework/data/aerospike/query/FilterOperation.java @@ -1309,14 +1309,11 @@ private static Optional getMetadataExp(Map qualifierMap) { // expecting value1 always be of type Long private static Long getValue1AsLongOrFail(Object value1) { - Long longValue1; try { - longValue1 = (Long) value1; + return (Long) value1; } catch (Exception e) { throw new IllegalArgumentException("Expecting value1 to be of type Long"); } - - return longValue1; } private static Exp mapMetadataExp(CriteriaDefinition.AerospikeMetadata metadataField) { diff --git a/src/main/java/org/springframework/data/aerospike/repository/query/ReactiveAerospikePartTreeQuery.java b/src/main/java/org/springframework/data/aerospike/repository/query/ReactiveAerospikePartTreeQuery.java index f2d77704f..82c814f96 100644 --- a/src/main/java/org/springframework/data/aerospike/repository/query/ReactiveAerospikePartTreeQuery.java +++ b/src/main/java/org/springframework/data/aerospike/repository/query/ReactiveAerospikePartTreeQuery.java @@ -60,16 +60,6 @@ public Object execute(Object[] parameters) { excludeIdQualifier(qualifiers)); } } -// -// // queries that include metadata have their own processing flow -// if (parameters != null && parameters.length > 0) { -// AerospikeCriteria criteria = query.getAerospikeCriteria(); -// if (isMetadataQuery(criteria)) { -// return runMetadataQuery(criteria, entityClass); -// } -// } -// -// return findByQuery(query, targetClass); } @@ -91,9 +81,4 @@ protected Object findByIds(Iterable iterable, Class sourceClass, Class return internalOperations.findByIdsInternal(IterableConverter.toList(iterable), sourceClass, targetClass, qualifiers); } - - protected Object runMetadataQuery(AerospikeCriteria criteria, Class entityClass) { - return operations.findByMetadata(criteria.getMetadataField(), criteria.getOperation(), - criteria.getValue1().toLong(), entityClass); - } }