Class CamelCaseToSnakeCaseNamingStrategy

  • All Implemented Interfaces:
    java.io.Serializable, org.hibernate.boot.model.naming.PhysicalNamingStrategy
    Direct Known Subclasses:
    CamelCaseToSnakeCaseNamingStrategy

    public class CamelCaseToSnakeCaseNamingStrategy
    extends org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
    Maps the JPA camelCase properties to snake_case database identifiers.

    For more details about how to use it, check out this article on vladmihalcea.com.

    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private org.hibernate.boot.model.naming.Identifier formatIdentifier​(org.hibernate.boot.model.naming.Identifier identifier)  
      org.hibernate.boot.model.naming.Identifier toPhysicalCatalogName​(org.hibernate.boot.model.naming.Identifier name, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment context)  
      org.hibernate.boot.model.naming.Identifier toPhysicalColumnName​(org.hibernate.boot.model.naming.Identifier name, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment context)  
      org.hibernate.boot.model.naming.Identifier toPhysicalSchemaName​(org.hibernate.boot.model.naming.Identifier name, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment context)  
      org.hibernate.boot.model.naming.Identifier toPhysicalSequenceName​(org.hibernate.boot.model.naming.Identifier name, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment context)  
      org.hibernate.boot.model.naming.Identifier toPhysicalTableName​(org.hibernate.boot.model.naming.Identifier name, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment context)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CamelCaseToSnakeCaseNamingStrategy

        public CamelCaseToSnakeCaseNamingStrategy()
        Initialization constructor taking the default Configuration object.
      • CamelCaseToSnakeCaseNamingStrategy

        public CamelCaseToSnakeCaseNamingStrategy​(Configuration configuration)
        Initialization constructor taking the Class and Configuration objects.
        Parameters:
        configuration - custom Configuration object.
    • Method Detail

      • toPhysicalCatalogName

        public org.hibernate.boot.model.naming.Identifier toPhysicalCatalogName​(org.hibernate.boot.model.naming.Identifier name,
                                                                                org.hibernate.engine.jdbc.env.spi.JdbcEnvironment context)
        Specified by:
        toPhysicalCatalogName in interface org.hibernate.boot.model.naming.PhysicalNamingStrategy
        Overrides:
        toPhysicalCatalogName in class org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
      • toPhysicalSchemaName

        public org.hibernate.boot.model.naming.Identifier toPhysicalSchemaName​(org.hibernate.boot.model.naming.Identifier name,
                                                                               org.hibernate.engine.jdbc.env.spi.JdbcEnvironment context)
        Specified by:
        toPhysicalSchemaName in interface org.hibernate.boot.model.naming.PhysicalNamingStrategy
        Overrides:
        toPhysicalSchemaName in class org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
      • toPhysicalTableName

        public org.hibernate.boot.model.naming.Identifier toPhysicalTableName​(org.hibernate.boot.model.naming.Identifier name,
                                                                              org.hibernate.engine.jdbc.env.spi.JdbcEnvironment context)
        Specified by:
        toPhysicalTableName in interface org.hibernate.boot.model.naming.PhysicalNamingStrategy
        Overrides:
        toPhysicalTableName in class org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
      • toPhysicalSequenceName

        public org.hibernate.boot.model.naming.Identifier toPhysicalSequenceName​(org.hibernate.boot.model.naming.Identifier name,
                                                                                 org.hibernate.engine.jdbc.env.spi.JdbcEnvironment context)
        Specified by:
        toPhysicalSequenceName in interface org.hibernate.boot.model.naming.PhysicalNamingStrategy
        Overrides:
        toPhysicalSequenceName in class org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
      • toPhysicalColumnName

        public org.hibernate.boot.model.naming.Identifier toPhysicalColumnName​(org.hibernate.boot.model.naming.Identifier name,
                                                                               org.hibernate.engine.jdbc.env.spi.JdbcEnvironment context)
        Specified by:
        toPhysicalColumnName in interface org.hibernate.boot.model.naming.PhysicalNamingStrategy
        Overrides:
        toPhysicalColumnName in class org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
      • formatIdentifier

        private org.hibernate.boot.model.naming.Identifier formatIdentifier​(org.hibernate.boot.model.naming.Identifier identifier)