I've got task to create application, which have rest services to attend on CRUD controllers with database.
So: I need to create rest services to bring on spring methods which execute methods from repository (JpaRepository - Spring Data), which create, read, update and delete on invented entity.
The code which "download" data should be in few versions:
- creating queries automaticly based on the method name
- creating queries defining her with @Query annotation (before method given to repository)
- creating queries using method shared by JpaRepository.
And basicly the problem is that I dont understand the question...
Like you can notice here:github I created this using 3rd point (JpaRepository), but I really don't understand how can I create CRUD queries automaticly without using JpaRepository. So my questions are:
- This question means that I need to create 3 times CRUD or just add 2 another services to my code?
- Can you show me sample how this query should look like in 1st and 2nd point?
- In Point 2 I need to use @query, from this spring documentation I know a lot about this annotation, but I don't know if it is possible to create those queries without my interface which expands JpaRepository?