87
JPA JPQL Basic Operations
JPQL allows us to create both static as well as dynamic queries. Now, we will perform some basic JPQL operations using both type of queries on the below table.
JPQL Dynamic Query Example
In this example, we will fetch single column from database by using createQuery() method .
StudentEntity.java
Persistence.xml
FetchColumn.java
Output:
JPQL Static Query Example
In this example, we will fetch single column from database by using createNamedQuery() method .
StudentEntity.java
Persistence.xml
FetchColumn.java
Next TopicJPA JPQL Bulk Data Operations