To be honest, Spring Data JPA useful, or was last used in 2013, it was just completed mapping and database tables in the Java Bean.
Recently think the cause with Spring Data JPA is a project at hand, source code is written in the native SQL + JDBC achieve, in the first deployment to initialize the database, also hardcode a lot of database configuration parameters. Just recently available, it is intended to transform what used Spring Boot Data JPA (spring-boot-starter-data-jpa), carefully looked at the source code has been found and the bad days to do a few years ago, if your business logic is not particularly or rational design of complex table structures, SQL logic implementation is not really a line to write, conscience ah, really for the sake of lazy people like me ah.
First started writing Repository, commonly used in two ways, one is to write an interface inheritance JpaRepository, code is as follows:
package com.company.inventory.repository;
Another is inherited CrudRepository, code is as follows:
package com.company.inventory.repository;
JpaRepository and CrudRepository relationship as follows:
public interface CrudRepository<T, ID> extends Repository<T, ID>
From the above relationship can be seen JpaRepository addition to all the things to do CrudRepository can do, but also more paging and sorting features and functions QueryByExampleExecutor QueryByExample provided. But also JpaRepository and JPA persistence technology is bound. http://jtuts.com/2014/08/26/difference-between-crudrepository-and-jparepository-in-spring-data-jpa/
It is proposed to make use of CrudRepository or PagingAndSortingRepository