liveBook · Manning

@Entity

As explained in Quarkus in Action

@Entity is a Jakarta Persistence annotation that declares a Java class to be a persistent entity.

@Entity marks a Java class as a persistent entity. In Quarkus Panache's active pattern, the class is a POJO annotated with @Entity and extended from PanacheEntity, giving it persistence behavior with minimal boilerplate. section 7.1.2

Reservation entity

A Reservation entity can expose public fields such as carId, userId, startDay, and endDay, while defining business behavior such as checking whether dates overlap. Panache supplies the identifier and accessors dynamically, and a custom identifier strategy can be used by extending PanacheEntityBase instead. section 7.1.2

How Quarkus in Action covers it

How deep it goes
Defines the annotation within Panache, including generated identifiers and accessors, but defers general JPA mapping detail.
Examples
Uses a Reservation class with reservation dates, a car identifier, a user identifier, and an overlap-checking method.
What it assumes
Assumes Java and Quarkus basics while teaching the entity definition from a plain Java object.
What you can do after
Build it from scratch as a concise Panache entity with generated persistence boilerplate and optional custom identifier handling.
How it connects
Connects persistent entities with PanacheEntity, PanacheEntityBase, Hibernate ORM, and PostgreSQL.

Also explained in

Compare how 2 books explain @Entity →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Quarkus in Action. The section links point to the parts of the book it draws on.