JPA Metamodel Types

The Jakarta Persistence (JPA) Metamodel API defines a structured hierarchy of interfaces and enumerations to represent the persistent types within a domain model.

Metamodel Types Hierarchy in Jakarta Persistence (JPA) 3.2

Base type definitions

The core abstractions of model types are the following components:

The top-level interface of the types hierarchy, representing any persistent Java type known to the persistence provider.

Represents basic foundation types (primitives, wrappers, Strings, or Dates) that do not contain persistent attributes of their own.

An enumeration defining the high-level classification of a type: BASIC, ENTITY, EMBEDDABLE, or MAPPED_SUPERCLASS, corresponding to the subinterfaces below.

Managed and identifiable types

Complex types that manage state through attributes form the core of the metamodel:

The common superinterface for entities, mapped superclasses, and embeddables, representing any type that manages attributes.

A managed type with a persistent identity (primary key), serving as the superinterface of entities and mapped superclasses.

Represents an @Entity class in the domain model, providing access to the entity's name, binding, and identifier attributes.

Represents a @MappedSuperclass, defining persistent state inherited by entities but not being entities themselves.

Represents an @Embeddable type, a managed type with attributes that lacks its own persistent identity and used for attributes.

For a detailed explanation of the type interface hierarchy and examples, see the Metamodel Type Interface Hierarchy section.