liveBook · Manning

Naming standard

As explained in Java Persistence with Spring Data and Hibernate epub

A naming convention is a prescribed pattern for naming database objects or other artifacts consistently.

A naming standard prescribes consistent names for database tables, columns, sequences, and related persistence artifacts. Hibernate can enforce these rules centrally instead of relying on repeated annotations that are easy to forget. section 5.3.1

Prefixing mapped table names

A PhysicalNamingStrategy can prepend CE_ to generated table names. For example, a mapped table named USERS becomes CE_USERS. Hibernate JPA enables the strategy through persistence.xml, while Spring Data JPA supplies the same property through LocalContainerEntityManagerFactoryBean configuration. section 5.3.1

Explicit @Table names remain useful for individual exceptions. Avoid reserved words and quoted identifiers when possible, because escaping complicates ad hoc SQL and reporting queries. Entity names for JPQL queries may also need explicit differentiation when classes share the same simple name. section 5.3.1

How Java Persistence with Spring Data and Hibernate epub covers it

How deep it goes
Explains explicit names, quoted identifiers, custom physical strategies, configuration, and JPQL entity-name collisions.
Examples
Uses @Table(name = "USERS"), a CE_ table prefix strategy, persistence.xml properties, and explicit AuctionItem entity naming.
What it assumes
Assumes basic entity mappings and persistence configuration while teaching naming strategies, identifier quoting, and query-name disambiguation.
What you can do after
Apply it via Hibernate configuration or explicit JPA annotations to enforce physical names and disambiguate query entities.
How it connects
Connects PhysicalNamingStrategy with Hibernate, JPA, Spring Data JPA, table mappings, quoted identifiers, and JPQL entity names.

Also explained in

Compare how 8 books explain naming standard →

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.