Using Java Persistence Query Language (JPQL)
In the preceding chapter, you saw how you can find and retrieve an entity instance by primary key with the help of the EntityManager’s find method. This method of retrieving entities has at least two serious limitations, however. First, you are limited to using primary keys only. Second, you can retrieve only a single entity instance at a time. In practice, however, you may need to retrieve a set of entity instances, based on a condition defined over entity attributes. This is where Java Persistence Query Language (JPQL) comes to the rescue.
KeywordsQuery Execution Query Interface Employee Instance Query Instance Preceding Chapter
Unable to display preview. Download preview PDF.