Spring Data JPA, part of the larger Spring Data family, makes it easy to easily implement JPA based repositories. This module deals with enhanced support for JPA based data access layers. It makes it easier to build Spring-powered applications that use data access technologies.
相比较于原始JPA或Spring JPA,Spring Data JPA封装和扩展更进了一步。基于XML和JavaConfig方式参考如下:
JPA xml namespace
1 |
|
JPA JavaConfig
1 |
|
Jpa Repositories
定义泛型参数化的继承Spring Data JPA的某一个接口,自动生成实现(org.springframework.data.jpa.repository.support.SimpleJpaRepository<T, ID>
),拥有18个基本方法
1 |
|