Spring Data JPA Tutorial - How to write custom query using Spring Data JPA | @Query with Springboot смотреть онлайн
#springboottutorial #SpringDatajpa #customquery #apitutorial
In this video, I have discussed how to write a custom Query in Spring Data JPA How to use JPQL (Java Persistence Query Language), How to execute SQL query in Spring Boot, and JPA Select query with WHERE condition example.
Please find the below details and Code uploaded in GitHub.
JPA Query Greater Than or Equal To
Spring Data JPA Query for Greater Than or Equal To date/column:
@Query("SELECT t FROM Tutorial t WHERE t.level )= ?1")
List(Tutorial) findByLevelGreaterThanEqual(int level);
@Query("SELECT t FROM Tutorial t WHERE t.createdAt )= ?1")
List(Tutorial) findByDateGreaterThanEqual(Date date);
JPA Query Between
Spring Data JPA Query Between date/column:
@Query("SELECT t FROM Tutorial t WHERE t.level BETWEEN ?1 AND ?2")
List(Tutorial) findByLevelBetween(int start, int end);
@Query("SELECT t FROM Tutorial t WHERE t.createdAt BETWEEN ?1 AND ?2")
List(Tutorial) findByDateBetween(Date start, Date end);
JPA Query Order By Desc/Asc
Spring Data JPA Query Order By column example with filtering:
@Query("SELECT t FROM Tutorial t ORDER BY t.level DESC")
List(Tutorial) findAllOrderByLevelDesc();
@Query("SELECT t FROM Tutorial t WHERE LOWER(t.title) LIKE LOWER(CONCAT('%', ?1,'%')) ORDER BY t.level ASC")
List(Tutorial) findByTitleOrderByLevelAsc(String title);
@Query("SELECT t FROM Tutorial t WHERE t.published=true ORDER BY t.createdAt DESC")
List(Tutorial) findAllPublishedOrderByCreatedDesc();
JPA Query Sort By
Spring Data JPA Query example using Sort class with filtering:
@Query("SELECT t FROM Tutorial t WHERE LOWER(t.title) LIKE LOWER(CONCAT('%', ?1,'%'))")
List(Tutorial) findByTitleAndSort(String title, Sort sort);
@Query("SELECT t FROM Tutorial t WHERE t.published=?1")
List(Tutorial) findByPublishedAndSort(boolean isPublished, Sort sort);
@Query("update t FROM Tutorial t WHERE t.published=true")
List(Tutorial) updateData();
JPA Query example with parameters
In the example above, we use Positional Parameters: the parameters is referenced by their positions in the query (defined using ? followed by a number (?1, ?2, …). Spring Data JPA will automatically replaces the value of each parameter in the same position.
Another way of binding value is Named Parameters. A named parameter starts with : followed by the name of the parameter (:title, :date, …).
For example:
@Query("SELECT t FROM Tutorial t WHERE t.published=:isPublished AND t.level BETWEEN :start AND :end")
List(Tutorial) findByLevelBetween(@Param("start") int start, @Param("end") int end, @Param("isPublished") boolean isPublished);
► SUBSCRIBE & LIKE!!
► Important Information and code guide available bottom of the Description section
► Official Email Id: [email protected]
► Download the Code from Github :https://github.com/admindebu/Spring-Data-JPA-Custom-Query-With-Spring-Boot
► Follow on Facebook: https://www.facebook.com/TechTalkDebu
► Follow on LinkedIn: https://www.linkedin.com/in/debu-paul
✅ ABOUT ME ✅
My name is Debu Paul. I am Currently working as a Senior Software Engineer in PayPal and on this channel I teach you about Java, Spring, Spring Boot, Rest API, Micro Service, Kafka, and other IT industry-related latest development, Testing tropic. I work hard to help you to understand latest technology and crack the interview and I will continue to do so in the future.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
► Here is our amazing playlist for Core Java, Spring MVC/Boot, Git and Microservice
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Core Java :: https://www.youtube.com/watch?v=IR_h0...
2. Core Java Important Interview QA : https://www.youtube.com/watch?v=CFoxr...
3. Spring MVC & Spring Boot :: https://www.youtube.com/watch?v=f-Wk1...
4. Micro Services :: https://www.youtube.com/watch?v=pscya...
5. Git/GitHub :: https://www.youtube.com/watch?v=XHxBA...
6. AWS :: https://www.youtube.com/watch?v=81Y_2...
7. Spring Security & OAuth : https://www.youtube.com/watch?v=AvV8l...
8. Coding and Programming : https://www.youtube.com/watch?v=o2BP4...
9. Raspberry PI & Arduino : https://www.youtube.com/watch?v=uauMF...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Watch my "Most Watched Videos"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
► HTTPS & HTTPS protocol :: https://www.youtube.com/watch?v=BlnSS...
What is Distributed Transactions
How to maintain Automicity in distributed Transaction
What is 2pc Pattern
What is SAGA pattern
What is Monolithic Architecture
What is Micro Service Architecture
Java Concurrency and Parallelism Tutorial
Java MultiThreading tutorial
Java tutorial
Javaconcurrencytutorial
core java tutorial
Future interface
Callable Interface
Runnable Interface
Callable Vs Runnable interface
Callable Vs Future Interface
Use of NewWorkStealingThreadPool method
How to develop asynchronous microservice
Spring Data JPA Tutorial and SPring Boot
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Spring Data JPA Tutorial - How to write custom query using Spring Data JPA | @Query with Springboot» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.