Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rameshmf/spring-data-jpa-tutorial
Guide to spring data jpa
https://github.com/rameshmf/spring-data-jpa-tutorial
jpa spring-boot spring-data-jpa spring-framework
Last synced: 3 months ago
JSON representation
Guide to spring data jpa
- Host: GitHub
- URL: https://github.com/rameshmf/spring-data-jpa-tutorial
- Owner: RameshMF
- Created: 2018-10-31T09:44:24.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-15T07:43:23.000Z (about 6 years ago)
- Last Synced: 2024-10-11T16:04:39.478Z (3 months ago)
- Topics: jpa, spring-boot, spring-data-jpa, spring-framework
- Language: Java
- Size: 60.5 KB
- Stars: 17
- Watchers: 3
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
- Spring Data JPA Tutorial - Getting Started - This article provides a quick introduction to Spring Data JPA. It also describes all the important interfaces of Spring data commons and Spring Data JPA - Repository, CrudRepository, PagingAndSortingRepository, QueryDslPredicateExecutor, JpaRepository, JpaSpecificationExecutor
- Spring Data JPA Tutorial - Java Based Configuration - This post describes a complete example of how to configure Spring Data JPA with hibernate using Java-based configuration.
- Spring Data JPA - Query Creation from Method Names - In this article, we will learn how we can create query methods by using the query generation from the method name strategy. We will demonstrate this with a complete end-to-end example using Spring boot.
- Spring Data JPA - Creating Database Queries With Named Queries - In this article, we will learn to create database queries by using named queries. We will demonstrate this with a complete end-to-end example using Spring boot.
- Spring Data JPA @NamedNativeQuery and @NamedNativeQueries Example - In this article, we will learn how to create database queries using @NamedNativeQuery and @NamedNativeQueries annotations. These annotations let you define the query in native SQL by losing the database platform independence.
Spring Data JPA - Creating Database Queries using @Query Annotation - This blog post describes how to create database queries using the @Query annotation. We will demonstrate this with a complete end-to-end example using Spring boot.
Spring Data JPA - Auditing with Spring Boot 2 and MySQL Example - In this article, we will discuss how can we configure JPA to automatically persist the CreatedBy, CreatedDate, LastModifiedBy, and LastModifiedDate columns for any entity. We will create a simple Spring Boot CRUD REST APIs and we implement auditing using spring data JPA.
Spring Data JPA - Working with Multiple Datasources using Spring Boot - In this article, we will learn how to configure multiple data sources and connect to multiple databases in a typical Spring Boot web application. We will use Spring Boot, JPA, Hibernate 5, Thymeleaf and H2 database to build a simple Spring Boot multiple data sources web application.
Spring Data JPA Repository Testing using Spring Boot @DataJpaTest - In this article, we will learn how to test Spring Data JPA Repositories using Spring Boot provided @DataJpaTest annotation.
Spring Data Java 8 Support - Spring Data now supports core Java 8 features – such as Optional, Stream API and CompletableFuture. In this quick article, we’ll go through some examples of how we can use these with the framework.
Spring Data Annotations - In this tutorial, we’ll see the most common annotations of the Spring Data, Spring Data JPA, and Spring Data MongoDB projects.
Basic Spring Data JPA Flow
Once you completed reading above all articles then let's understand basic flow at the time of accessing the database using Spring Data JPA is shown below.
Sr.No.Description
(1)
Call the method of Repository interface from Service.
Entity object, Entity ID etc. are passed as method calling parameters. In the above example, the entity is passed, however, a primitive value can also be passed.
(2)
A proxy class which dynamically implements Repository interface delegates the process toorg.springframework.data.jpa.repository.support.SimpleJpaRepository
or custom Repository class.
Parameters specified by Service are passed.
(3)
Repository implementation class calls JPA APIs.
The parameters specified by Service and the parameters generated by the implementation class of the Repository are passed.
(4)
Hibernate JPA reference implementation calls the Hibernate core APIs.
The parameters specified by the implementation class of the Repository and the parameters generated by Hibernate JPA reference implementation are passed.
(5)
Hibernate Core API generates SQL and bind values from the specified parameters and passes to JDBC driver.
(API of java.sql.PreparedStatement is used for binding the actual values.)
(6)
JDBC driver executes SQL.
Useful Resources and Links
This section showcases useful material created by other developers. If you have written a blog post or recorded a video about Spring Data JPA, and want to include it to this section, do comment and I will check it out. If I think that it is useful, I will add it to this section.
Reference Manuals and Official Guides
- Spring Data JPA - Reference Documentation
- Spring Data JPA API (Java Doc)
- Spring Data (Part of Spring Framework Project)
- Spring Data Rest API JavaDocs
- Accessing Data with JPA
Blog Posts/Articles
- Spring Data Java 8 Support
- Spring Data JPA Tutorial: Sorting
- Spring Data JPA Tutorial: Pagination
- Spring Data JPA Tutorial: Integration Testing
- Spring Data JPA Tutorial: Adding Custom Methods to a Single Repository
Top J2EE Tutorials