liveBook · Manning

Table annotation

As explained in Java Persistence with Spring Data and Hibernate epub

A table annotation is a JPA annotation that specifies relational-table mapping details for an entity class.

A table annotation specifies relational-table mapping details for an entity class. Without it, JPA derives the table name from the class, such as Item to ITEM or BidItem to BID_ITEM; @Table can override that name and provide catalog or schema prefixes. section 5.3.1

Mapping an entity to USERS

@Entity @Table(name = "USERS") public class User { // ... } This avoids mapping User to USER, a reserved keyword in many SQL database systems. section 5.3.1

How Java Persistence with Spring Data and Hibernate epub covers it

How deep it goes
Explains defaults, explicit names, prefixes, and quoted identifiers, but defers broader entity-mapping details.
Examples
Uses Item, BidItem, User, USERS, reserved identifiers, and PhysicalNamingStrategy examples.
What it assumes
Assumes basic entity annotations and SQL naming, while explaining default name derivation from Java classes.
What you can do after
Apply it via the JPA @Table annotation to override derived table names and avoid reserved-name conflicts.
How it connects
Connects entity classes with naming conventions, SQL identifiers, schemas, catalogs, and physical naming strategies.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Java Persistence with Spring Data and Hibernate epub. The section links point to the parts of the book it draws on.