Javatpoint Logo
Javatpoint Logo

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.


JPA JPQL Basic Operations

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:


JPA JPQL Basic Operations

JPQL Static Query Example

In this example, we will fetch single column from database by using createNamedQuery() method .

StudentEntity.java

Persistence.xml

FetchColumn.java


JPA JPQL Basic Operations




Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA