JPA Metamodel API

The JPA Metamodel API, which is introduced in JPA 2.0, enables examining the classes, fields and properties of the persistent object model, similarly to the Java reflection API.

The main interface of the JPA Metamodel API is:

Types (mainly classes) and attributes (persistent field and properties) in the persistent object model are represented by the following sets of interfaces and enum types:

The JPA Metamodel API may optionally be used with the JPA Criteria API. Many of the interfaces in the above sets extend the Bindable interface, which may be used in defining criteria query variables in the FROM clause:

See the JPA Metamodel API page (in the ObjectDB manual) for more details and examples.