Class CamelCaseToSnakeCaseNamingStrategy
- java.lang.Object
-
- org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
-
- com.vladmihalcea.hibernate.naming.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
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CAMEL_CASE_REGEX
private Configuration
configuration
static CamelCaseToSnakeCaseNamingStrategy
INSTANCE
static java.lang.String
SNAKE_CASE_PATTERN
-
Constructor Summary
Constructors Constructor Description CamelCaseToSnakeCaseNamingStrategy()
Initialization constructor taking the defaultConfiguration
object.CamelCaseToSnakeCaseNamingStrategy(Configuration configuration)
Initialization constructor taking theClass
andConfiguration
objects.
-
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)
-
-
-
Field Detail
-
INSTANCE
public static final CamelCaseToSnakeCaseNamingStrategy INSTANCE
-
CAMEL_CASE_REGEX
public static final java.lang.String CAMEL_CASE_REGEX
- See Also:
- Constant Field Values
-
SNAKE_CASE_PATTERN
public static final java.lang.String SNAKE_CASE_PATTERN
- See Also:
- Constant Field Values
-
configuration
private final Configuration configuration
-
-
Constructor Detail
-
CamelCaseToSnakeCaseNamingStrategy
public CamelCaseToSnakeCaseNamingStrategy()
Initialization constructor taking the defaultConfiguration
object.
-
CamelCaseToSnakeCaseNamingStrategy
public CamelCaseToSnakeCaseNamingStrategy(Configuration configuration)
Initialization constructor taking theClass
andConfiguration
objects.- Parameters:
configuration
- customConfiguration
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 interfaceorg.hibernate.boot.model.naming.PhysicalNamingStrategy
- Overrides:
toPhysicalCatalogName
in classorg.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 interfaceorg.hibernate.boot.model.naming.PhysicalNamingStrategy
- Overrides:
toPhysicalSchemaName
in classorg.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 interfaceorg.hibernate.boot.model.naming.PhysicalNamingStrategy
- Overrides:
toPhysicalTableName
in classorg.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 interfaceorg.hibernate.boot.model.naming.PhysicalNamingStrategy
- Overrides:
toPhysicalSequenceName
in classorg.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 interfaceorg.hibernate.boot.model.naming.PhysicalNamingStrategy
- Overrides:
toPhysicalColumnName
in classorg.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
-
formatIdentifier
private org.hibernate.boot.model.naming.Identifier formatIdentifier(org.hibernate.boot.model.naming.Identifier identifier)
-
-