Nie rozumiem jak dzialaja interfejsy JpaRepository, CrudRepository czy PagingandSortingRepository w Springu.
Mam aplikacje w spring-boot z zdefiniowana domain z adnotacja @Entity. Do tego dolaczam interfejs:
public interface MyRepository extends JpaRepository<My, Long> {
}
i to juz dziala....!!?? Wystawia REST API - wszystko OK. Ale gdzie sie to dzieje i jak sie to odbywa? Czy SpringFramework tutaj cos dziala?
dependencies {
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-data-rest')
compile('org.springframework.boot:spring-boot-starter-thymeleaf')
compile('org.springframework.boot:spring-boot-starter-web')
/* compile("org.springframework.boot:spring-boot-devtools") */
runtime('mysql:mysql-connector-java')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
Czytam ksiazki = Interfejs to zbior abstrakcyjnych metod bez cial. "Spaceruje" po tych wszystkkich klasach bazowych az do Repository i nic.
Nie rozumiem :-(