I started to read this tutorial: spring boot tutorial
In this I read that under model module they implemented POJOs and Repository interfaces. -> tutorial on github
In Repository interfaces I found two methods without implementations: findByUsername, findByAccountUsername.
My questions are:
- How does it work when those methods in repository interfaces have no implementations and those are not inherited from any super class?
- Does it work with name conventions and reflections?
- Does Spring Data has inmemory database to work with?
For your question 1 and 2, they are right. They use naming convention and reflection. If you don't want to use their naming convention, you can use @Query with HQL, and certainly the hidden class (which implements for your interface) will handle these query also (you don't need to roll the implementation out).
For your last question, as list of IMDB here: https://en.wikipedia.org/wiki/List_of_in-memory_databases , spring data is not supporting for them. You must invoke another Java driver or spring product for each one.
The Repository interfaces are being implemented (backed up) by Spring Container at Runtime.
Yes, it works on naming conventions and spring container uses JDK's proxy classes to intercept the calls to the Repository.
No, Spring does not use any inmemory database
Please refer the below link for more detailed explanation:
How are Spring Data repositories actually implemented?