Spring Data Aerospike repository query

spring
secondary
java
query

#1

Hi,

I’ve integrated aerospike into a spring boot project. I’m trying to search for a string containing a value.

I’ve read this:

Also cloned this repo:

In my table ‘event’ i have a column ‘home’ which i have setup as my secondary index. My repos looks like this atm.

    public interface EventRepository extends AerospikeRepository<Event, UUID> {

    List<Event> findByHomeLike(String home);

}

However, i don’t want to use the ‘Like’ query because this only seems to match the start of the string. I’ve tried findByHomeContaining, findByHomeContains but seem to get a null pointer at Query.addCriteria. Specifically this.

CriteriaDefinition existing = this.criteria
				.get(criteriaDefinition.getKey());
		String key = criteriaDefinition.getKey();

Any help would be appreciated thanks.


#2

LIKE seems being treated as StartingWith. Contains has not defined yet (return null) with the current version.

Thanks and will take a look into this.


#3

Will Contains be implemented? If so will it take long?


#4

Can you try to pull the last code from spring-data-aerospike and test with contains query?


#5

Have you changed the pom.xml? The tests seem to fail because it can’t connect to an aerospike client, but this wasn’t the case before. I’ve got the latest code however and build the jar but seems to have broken my code. Spring can’t create some of my beans.

Parameter 0 of constructor in org.springframework.data.aerospike.repository.support.AerospikeRepositoryFactoryBean required a bean of type 'java.lang.Class' that could not be found.

^ Error showing


#6

The pom file was not touched. I would double-check if the new jar has been included in the class path of the test code.


#7

Working now thanks! But it doesn’t seem to take case sensitivity into account. So like:

findByHomeContainingIgnoreCase


#8

Try another pull, it should have support for ContainingIgnoreCase now.


#9

Working, thank you so much!