0

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.

Rod Salas
  • 5
  • 1

2 Answers2

0

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

claus
  • 377
  • 2
  • 9
0

please note that the crate java-client is not supported anymore since v0.57 unfortunately.

https://crate.io/docs/clients/java/

This leaves us with the java-jdbc:

https://github.com/crate/crate-sample-apps/blob/master/java/documentation.md

Spring data adapter is using the java-client.

Here is a Spring Boot application that is using JDBC in order to access CrateDB (> v0.57.0) https://github.com/klearchos/crate

And here are the official samples in order to access CreateDB through JDBC (using the Spark framework). https://github.com/crate/crate-sample-apps/tree/master/java

Investigator
  • 1,431
  • 2
  • 17
  • 24