Package jakarta.persistence.metamodel


package jakarta.persistence.metamodel
Defines the Jakarta Persistence Metamodel API, allowing runtime reflection on the managed types declared by a persistence unit.

Instances of metamodel types may be obtained either:

The Metamodel API allows programmatic lookup, but is not in general typesafe.

SingularAttribute<Book,String> isbnAttribute =
        factory.getMetamodel()
            .entity(Book.class)
            .getId(String.class);

A static metamodel class is a class with static members providing direct type safe access to the metamodel objects representing the persistent members of a given managed class.

SingularAttribute<Book,String> isbnAttribute = Book_.isbn;
Since:
2.0