From the course: Java Persistence with JPA and Hibernate
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
JPQL queries - JPA Tutorial
From the course: Java Persistence with JPA and Hibernate
JPQL queries
- [Instructor] JPQL or Jakarta Persistence Query Language is kind of an adoption of SQL, because its syntax is quite similar to SQL. JPQL is used to issue queries on a database within an ORM framework. Unlike SQL, where queries are issued directly on the database, in JPQL, queries are issued on the entity model. In other words, queries are issued on the entity instances in the persistence context. This makes it very convenient for Java developers to use, because JPQL queries work with entity instances in the context, but the language, that the database understands, is SQL. So whatever the JPQL queries that the application issues should be transformed to SQL by Hibernate or the ORM framework that's used. So essentially the JPQL queries that you write should be a valid SQL. Also, prior to learning how to write JPQL queries, it's important that you are familiar with the SQL syntaxes. To ensure that we are issuing valid SQL, it's advisable to log SQL statements by setting the…
Contents
-
-
-
-
-
-
-
-
-
(Locked)
JPQL queries10m 47s
-
(Locked)
Joins with JPQL9m 11s
-
(Locked)
Named queries5m 15s
-
(Locked)
Aggregate functions8m 43s
-
(Locked)
ORDER BY, GROUP BY, and HAVING9m 17s
-
(Locked)
Native queries5m 11s
-
(Locked)
Criteria queries12m 8s
-
(Locked)
Challenge: Art Class Management app, part 51m 4s
-
(Locked)
Solution: Art Class Management app, part 55m 19s
-
(Locked)
-
-