spring-data-jpa

Topics related to spring-data-jpa:

Getting started with spring-data-jpa

This section provides an overview of what spring-data-jpa is, and why a developer might want to use it.

It should also mention any large subjects within spring-data-jpa, and link out to the related topics. Since the Documentation for spring-data-jpa is new, you may need to create initial versions of those related topics.

Repositories

The Spring Data project allows application programmers to work with data stores using a consistent interface that makes use of an abstraction called Repository. A Spring Data Repository is modeled after the Repository pattern made popular by domain-driven design. Spring Data provides a central Java interface named Repository that subprojects can extend to provide features specific to data stores.

In addition to the Repository interface, Spring Data also provides two more core interfaces - CrudRepository that defines the contract for basic CRUD (create, read, update and delete) functionality; and PagingAndSortingRepository that extends CrudRepository by defining a contract for pagination and sorting.

These three core interfaces (Repository, CrudRepository and PagingAndSortingRepository) ensure that:

  1. Application programmers can access data stores (such as relational databases, document based NoSQL databases, graph databases, etc.) in a consistent way.
  2. It is easy to switch the underlying storage for a domain entity (see domain-driven design) without having to also change the way in which the application interacts with the data store.
  3. Specific implementations can provide features specific to data stores.