spring-datacrate

Spring Data Crate custom queries


I am trying to implement Spring Data Crate API in a project. Following the instructions provided here:

https://crate.io/a/using-sprint-data-crate-with-your-java-rest-application/

Inserts/Updates/FindById methods are covered. My question is how to create custom queries using this API.


Solution

  • Have you looked at our Spring Data adapter?

    Declared Queries

    It's also possible to use the @Query annotation to define queries:

    public interface UserRepository extends CrateRepository<User, String> {
    
        @Query("select * from users")
        List<User> getAllUsers();
    }
    

    https://github.com/crate/spring-data-crate#declared-queries