JPA Examples In Eclipse
In the JPA Examples section we will provide you almost all the examples of JPA framework.
In the JPA Examples section we will provide you almost all the examples of JPA framework.
JPA Examples In Eclipse

In the JPA Examples section we will provide you almost all the examples of
JPA framework. This complete JPA tutorials will illustrate you all the features
and different usages of JPA API.
We are using Eclipse IDE to develop and test the examples. Hibernate is used
as JPA persistence provider framework in the examples. But you can also switch
to other persistence providers such as iBatis or Toplink. At the end of the
tutorial we have provided the link to download full source code the JPA Example
code.
In this JPA tutorials we have provided examples of EJB QL, JPA Native Query,
JPA Named query, JPA Subquery and many more. So, let's get started with JPA
Examples using Eclipse IDE.
- JPA setFirstResult
In this section, you will learn how to use setFirstResult
method in your jpa application.
- JPA setMaxResults
In this section, you will learn how to use the setMaxResults()
method in your JPA application.
- JPA
setParameter (Named Parameter)
In this section, you will learn about the JPA Query API's method setParameter
as a named parameter.
- JPA
setParameter (Numbered Parameter)
In the previous section we studied about the
setParameter. Here, we will see setParameter to set a numbered
parameter.
- JPA getResultList
In this section, you will see how to use the getResultList()
method in your JPA application.
- JPA
getSingleResult
In this section, you will see how to use the getSingleResult()
method is your JPA application.
- JPA executeUpdate
In this section, we will learn how to use executeUpdate() method in
your JPA application.
- JPA-QL Queries
In this section, we will use the simple JPA-QL query in our JPA
application.
- JPA Native Queries
In this section, you will know about the jpa native queries and how to
use native query in your JPA application.
- JPA Named Query
In this section, you read about the JPA Query, its types and how to
integrate the JPA Named Query in your JPA application.
- JPA Named Queries
In this section, you will read about the JPA Query,
its types and how to use the JPA Named Query in your JPA application.
- JPA Named
Parameter
In this section, you will learn how to use JPA
Named Parameter in your jpa application. In JPA named parameter is used
where you assign names.
- JPA
Positional Parameter
In this section, you will learn about the JPA Positional Parameter and how
to use in your JPA application.
- JPA Named
Parameter List
In this section, you will learn how to develop a JPA application using JPA
Named Parameter List.
- JPA Ordering
In this section, you will learn about the JPA Ordering and how to
develop JPA application using ordering.
- JPA Grouping
In this section, you will learn about the JPA Grouping and how to use it in
your JPA application.
- JPA Sub-Queries
In this section, you will see how to use sub-queries in your JPA
application.
- JPA Aggregates
In JPQL (Java Persistence Query Language) queries, we can select
the aggregate data as well as objects. There are following types of aggregate
functions:
Avg()
Sum()
-
M
in()
Max()
Count()
- JPQL Functions
JPQL
(Java Persistence Query Language) supports a predefined set
of functions as follow:
- Concat()
- SubString()
- Trim()
- Lower()
- Upper()
- Lenght()
- Locate()
- Abs()
- Sqrt()
- Mod()
Ads