Package google.registry.persistence
Class NomulusNamingStrategy
java.lang.Object
google.registry.persistence.NomulusNamingStrategy
- All Implemented Interfaces:
org.hibernate.boot.model.naming.PhysicalNamingStrategy
public class NomulusNamingStrategy
extends Object
implements org.hibernate.boot.model.naming.PhysicalNamingStrategy
Nomulus naming strategy for Hibernate ORM.
This class applies the following naming strategies to protect readability of SQL statements:
- Table names are quoted UpperCamelCases.
- Column names are in lower_underscore format.
The use of quoted names may introduce portability problems with hand-crafted SQL queries, e.g., between postgresql (which only accepts double-quotes) and MySQL(which only accepts back-quotes). This gives us incentives for adopting SQL query builders such as JOOQ for reporting etc.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.hibernate.boot.model.naming.Identifier
toPhysicalCatalogName
(org.hibernate.boot.model.naming.Identifier name, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment jdbcEnvironment) org.hibernate.boot.model.naming.Identifier
toPhysicalColumnName
(org.hibernate.boot.model.naming.Identifier name, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment jdbcEnvironment) org.hibernate.boot.model.naming.Identifier
toPhysicalSchemaName
(org.hibernate.boot.model.naming.Identifier name, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment jdbcEnvironment) org.hibernate.boot.model.naming.Identifier
toPhysicalSequenceName
(org.hibernate.boot.model.naming.Identifier name, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment jdbcEnvironment) org.hibernate.boot.model.naming.Identifier
toPhysicalTableName
(org.hibernate.boot.model.naming.Identifier name, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment jdbcEnvironment)
-
Constructor Details
-
NomulusNamingStrategy
public NomulusNamingStrategy()
-
-
Method Details
-
toPhysicalCatalogName
public org.hibernate.boot.model.naming.Identifier toPhysicalCatalogName(org.hibernate.boot.model.naming.Identifier name, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment jdbcEnvironment) - Specified by:
toPhysicalCatalogName
in interfaceorg.hibernate.boot.model.naming.PhysicalNamingStrategy
-
toPhysicalSchemaName
public org.hibernate.boot.model.naming.Identifier toPhysicalSchemaName(org.hibernate.boot.model.naming.Identifier name, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment jdbcEnvironment) - Specified by:
toPhysicalSchemaName
in interfaceorg.hibernate.boot.model.naming.PhysicalNamingStrategy
-
toPhysicalTableName
public org.hibernate.boot.model.naming.Identifier toPhysicalTableName(org.hibernate.boot.model.naming.Identifier name, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment jdbcEnvironment) - Specified by:
toPhysicalTableName
in interfaceorg.hibernate.boot.model.naming.PhysicalNamingStrategy
-
toPhysicalSequenceName
public org.hibernate.boot.model.naming.Identifier toPhysicalSequenceName(org.hibernate.boot.model.naming.Identifier name, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment jdbcEnvironment) - Specified by:
toPhysicalSequenceName
in interfaceorg.hibernate.boot.model.naming.PhysicalNamingStrategy
-
toPhysicalColumnName
public org.hibernate.boot.model.naming.Identifier toPhysicalColumnName(org.hibernate.boot.model.naming.Identifier name, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment jdbcEnvironment) - Specified by:
toPhysicalColumnName
in interfaceorg.hibernate.boot.model.naming.PhysicalNamingStrategy
-