Criteria API
In a similar way to JPQL, Criteria API gives tools for querying the persistence graph, but in this case by using objects instead of a DSL.
These queries are harder to read, but easier to modify dynamically.
Creating a Query
This JPQL query:
Is equivalent to this:
Metamodel
The DefaultSimpleEntity_ is a class containing only metadata to be used by JPA, so when this constant is used:
It is making a reference to this metamodel field:
Which describes this entity field:
The metamodel can be generated automatically from a persistence entity with the help of a project management tool. This way any change to the entity is always mirrored by the metamodel.
More Information
Last updated
Was this helpful?