Spring Data

Each of the data stores have different ways to connect and retrieve/update data. Spring Data aims to provide a consistent model--another level of abstraction - to access data from different kinds of data stores.

Some of the important Spring Data features are listed as follows:

  • Easy integration with multiple data stores through various repositories
  • The ability to parse and form queries based on repository method names
  • Provides the default CRUD functionality
  • Basic support for auditing, such as created by user and last changed by user
  • Powerful integration with Spring
  • Great integration with Spring MVC to expose REST controllers through Spring Data Rest

Spring Data is an umbrella project made up of a number of modules. A few of the important Spring Data modules are listed as follows:

  • Spring Data Commons: Defines the common concepts for all Spring Data modules--repository and query methods
  • Spring Data JPA: Provides easy integration with JPA repositories
  • Spring Data MongoDB: Provides easy integration with MongoDB--a document-based data store
  • Spring Data REST: Provides the functionality to expose Spring Data repositories as REST services with minimal code
  • Spring Data for Apache Cassandra: Provides easy integration with Cassandra
  • Provides easy integration with Hadoop

In this chapter, we will take an in-depth look at the common concepts behind Spring Data, repository, and query methods. In the initial examples, we will use Spring Data JPA to illustrate these concepts. We will also take a look at a sample integration with MongoDB later in the chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset