0% found this document useful (0 votes)
8 views2 pages

Spring - Part-6 - 24-June-2024

Uploaded by

amancsc2212
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Spring - Part-6 - 24-June-2024

Uploaded by

amancsc2212
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Date:24/June/2024

-----------------
Spring Data JPA Module (Java Persistence API)
----------------------

Spring JDBC
-----------
interface StudentDAO
{
CRUD operations
}
public class StudentDAOImpl implements StudentDAO
{
//implement interface methods
//overridden CRUD operations
}

Spring ORM
----------
interface EmployeeDAO
{
CRUD operations
}
public class EmployeDAOImpl implements EmployeeDAO
{
//implement interface methods
//overridden CRUD operations
}

20 DAO interfaces => 20 DAO implementation classes

Spring Data JPA (Java Persistence API)


---------------
JpaRepository interface is used for Spring Data JPA Module

Ex:
@Repository
interface EmployeeRepository extends JpaRepository<Employee,Integer>{}

@Repository
interface StudentRepository extends JpaRespository<Student,Integer>{}

Note: Hibernate is an implementation of JPA

Spring DATA JPA methods


------------------------
- save()
- deleteById()
- findById() => primary key
- findAll()

Spring REST Module


------------------
- REST stands for REpresentational State Transfer
- Spring REST Module is used to create REST APIs

REST APIs are used to develop distributed applications which are used to interact
one application with another application
@RestController annotation is used to mark the class as Rest Controller class

Spring REST Annotations


-----------------------
@PostMapping (Insert operation)
@PutMapping (Update operation)
@DeleteMapping (Delete operation)
@GetMapping (Select operation)

Spring Boot REST CRUD Application with POSTMAN Client


-----------------------------------------------------
Refer document Spring Boot REST CRUD Application with POSTMAN.docx

Refer source codes in SpringBootRESTCRUDProj.ZIP

You might also like