liveBook · Manning

PhysicalNamingStrategy

As explained in Java Persistence with Spring Data and Hibernate epub

PhysicalNamingStrategy is a Hibernate interface for transforming logical database artifact names into their physical names.

PhysicalNamingStrategy lets Hibernate transform logical database artifact names into physical names, enforcing conventions without repeating @Table mappings on every entity. section 5.3.1

Prefixing physical table names

Extend PhysicalNamingStrategyStandardImpl and override toPhysicalTableName() to return an Identifier prefixed with CE_. Enable the implementation with hibernate.physical_naming_strategy in persistence.xml or Spring Data JPA configuration.

The interface supports broader physical-schema customization:

  • Customize columns, sequences, and other database artifacts through corresponding naming methods. section 5.3.1
  • Prefer centralized conventions when manually specifying @Table names would be repetitive or easy to forget. section 5.3.1

How Java Persistence with Spring Data and Hibernate epub covers it

How deep it goes
Explains table-name overriding and configuration, while only identifying column and sequence customization as available methods.
Examples
Uses a CENamingStrategy that prefixes generated table names with CE_ and configures it in JPA or Spring.
What you can do after
Operate/configure Hibernate to apply centralized physical naming rules instead of repeating table annotations.
How it connects
Connects Hibernate naming, JPA persistence.xml, Spring Data JPA configuration, and @Table mappings.

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.