Chapter-06: Custom methods using Query by annotation | @Query, @NamedQuery | Spring Data JPA

Опубликовано: 15 Март 2026
на канале: Abhishek Verma
1,172
49

This is a technical video of Spring Data JPA series. In this, I have tried to explain how to implement Query by annotation in Repository layer using Spring Data JPA.

First of all there is a recap of previous video and then with the help of code we have implemented Query by annotation in the repository layer. We will see use of @Query, @NamedQuery and @NamedNativeQuery annotations.

Don’t forget to like, comment, and share with other developers working with databases!

For educational purposes only.
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
You can download the code shown in video from : https://github.com/abhishekvermaa10/S...
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
00:00 Introduction
00:34 Recap of previous video
02:58 Implementing Query By annotation
07:15 Theory - Query By annotation
14:18 Back to implementation
27:50 Executing the code
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Software Requirements:
• Java 21: https://www.oracle.com/in/java/techno...
• Spring Tool Suite (STS) 4: https://spring.io/tools
• MySQL Community Server 8.4: https://dev.mysql.com/downloads/mysql
• DBeaver: https://dbeaver.io
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Social Media Handles:
• Telegram: https://t.me/ScaleUpIndiayt
• YouTube:    / @abhishekvermaa10  
• Instagram:   / abhishekvermaa10  
• LinkedIn:   / abhishekvermaa10  
• GitHub: https://github.com/abhishekvermaa10
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Download and Install videos:
• Java 21:    • Download and Install Java 21 | Works for J...  
• Spring Tool Suite (STS) 4:    • Download and Install Spring Tool Suite (ST...  
• MySQL 8.4:    • Download and Install MySQL Community Serve...  
• DBeaver:    • How to Install DBeaver and Connect to MySQ...  
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Binge watch videos and playlists:
• Daily Interview series:    • Concept-in-a-Minute  
• Multithreading:    • Chapter-04: Unlocking the Multithreading M...  
• Concurrency:    • Chapter-05: Mastering Concurrency in Java:...  
• Generics:    • Chapter-02: How Generics Simplify Data Str...  
• Collection Framework:    • Chapter-03: Say Goodbye to Arrays: The Pow...  
• Exception Handling:    • Chapter-01: Java Exception Handling: Unloc...  
• Lambda Expression:    • Chapter-06: Supercharge Java Projects with...  
• Streams API:    • Chapter-07: Stream API Decoded: Transformi...  
• Optional Class:    • Chapter-08: Null No More: Master Java's Op...  
• DateTime API:    • Chapter-09: Untold Stories of Java DateTim...  
• JDBC:    • Java Database Connectivity (JDBC)  
• Maven:    • Maven  
• Hibernate:    • Hibernate  
• Spring Basics with Spring Boot:    • Spring Basics with Spring Boot  
• Spring Data JPA with Spring Boot:    • Spring Data JPA with Spring Boot  
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Copyright © 2024 Abhishek Verma - All Rights Reserved