O'Reilly logo

The Java EE 6 Tutorial: Basic Concepts, Fourth Edition by Chinmayee Srivathsa, Kim Haase, Devika Gollapudi, Ian Evans, Eric Jendrock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 22. Using the Criteria API to Create Queries

The Criteria API is used to define queries for entities and their persistent state by creating query-defining objects. Criteria queries are written using Java programming language APIs, are typesafe, and are portable. Such queries work regardless of the underlying data store.

The following topics are addressed here:

• “Overview of the Criteria and Metamodel APIs” on page 415

• “Using the Metamodel API to Model Entity Classes” on page 417

• “Using the Criteria API and Metamodel API to Create Basic Typesafe Queries” on page 418

Overview of the Criteria and Metamodel APIs

Similar to JPQL, the Criteria API is based on the abstract schema of persistent entities, their relationships, and embedded ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required