Using the Select query
The Select query is a very useful query as it returns a subset of one or more tables of a database. The query can be used to select which rows of a table should be returned and which fields of each row. When the query is executed a list of results is returned and can be processed and/or displayed by the application.
The steps used to create and use a JPQL Select query include:
- Obtaining an instance of an
- Using the
createQuerymethod to create an instance of a
Querybased on a Select JPQL string argument
- Using a method such as the
getResultListto execute and return the results of the query
The easiest place to find an instance of the
EntityManageris in a facade class. This is where we will place our ...