Top Description Constructors Methods
org.hibernate.boot.model.naming

public Class CamelCaseToUnderscoresNamingStrategy

extends Object
implements PhysicalNamingStrategy
Class Inheritance
All Implemented Interfaces
org.hibernate.boot.model.naming.PhysicalNamingStrategy
Imports
java.util.Locale, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment

Originally copied from Spring Boot as this strategy is popular there (original name is SpringPhysicalNamingStrategy).
Authors
Phillip Webb, Madhura Bhave

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private Identifier
apply(final Identifier name, final JdbcEnvironment jdbcEnvironment)

protected Identifier

Returns:

an identifier instance
getIdentifier
(String
the name of the identifier
name
,
final boolean
if the identifier is quoted
quoted
,
final JdbcEnvironment
the JDBC environment
jdbcEnvironment
)

Get an identifier for the specified details.

protected boolean

Returns:

true if the database is case insensitive sensitivity
isCaseInsensitive
(JdbcEnvironment
the JDBC environment which can be used to determine case
jdbcEnvironment
)

Specify whether the database is case sensitive.

private boolean
isUnderscoreRequired(final char before, final char current, final char after)

public Identifier
toPhysicalCatalogName(Identifier logicalName, JdbcEnvironment jdbcEnvironment)

Implements org.hibernate.boot.model.naming.PhysicalNamingStrategy.toPhysicalCatalogName.

Determine the physical catalog name from the given logical name
public Identifier
toPhysicalColumnName(Identifier logicalName, JdbcEnvironment jdbcEnvironment)

Implements org.hibernate.boot.model.naming.PhysicalNamingStrategy.toPhysicalColumnName.

Determine the physical column name from the given logical name
public Identifier
toPhysicalSchemaName(Identifier logicalName, JdbcEnvironment jdbcEnvironment)

Implements org.hibernate.boot.model.naming.PhysicalNamingStrategy.toPhysicalSchemaName.

Determine the physical schema name from the given logical name
public Identifier
toPhysicalSequenceName(Identifier logicalName, JdbcEnvironment jdbcEnvironment)

Implements org.hibernate.boot.model.naming.PhysicalNamingStrategy.toPhysicalSequenceName.

Determine the physical sequence name from the given logical name
public Identifier
toPhysicalTableName(Identifier logicalName, JdbcEnvironment jdbcEnvironment)

Implements org.hibernate.boot.model.naming.PhysicalNamingStrategy.toPhysicalTableName.

Determine the physical table name from the given logical name
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

CamelCaseToUnderscoresNamingStrategyback to summary
public CamelCaseToUnderscoresNamingStrategy()

Method Detail

applyback to summary
private Identifier apply(final Identifier name, final JdbcEnvironment jdbcEnvironment)
getIdentifierback to summary
protected Identifier getIdentifier(String name, final boolean quoted, final JdbcEnvironment jdbcEnvironment)

Get an identifier for the specified details. By default this method will return an identifier with the name adapted based on the result of isCaseInsensitive(JdbcEnvironment)

Parameters
name:String

the name of the identifier

quoted:boolean

if the identifier is quoted

jdbcEnvironment:JdbcEnvironment

the JDBC environment

Returns:Identifier

an identifier instance

isCaseInsensitiveback to summary
protected boolean isCaseInsensitive(JdbcEnvironment jdbcEnvironment)

Specify whether the database is case sensitive.

Parameters
jdbcEnvironment:JdbcEnvironment

the JDBC environment which can be used to determine case

Returns:boolean

true if the database is case insensitive sensitivity

isUnderscoreRequiredback to summary
private boolean isUnderscoreRequired(final char before, final char current, final char after)
toPhysicalCatalogNameback to summary
public Identifier toPhysicalCatalogName(Identifier logicalName, JdbcEnvironment jdbcEnvironment)

Implements org.hibernate.boot.model.naming.PhysicalNamingStrategy.toPhysicalCatalogName.

Doc from org.hibernate.boot.model.naming.PhysicalNamingStrategy.toPhysicalCatalogName.

Determine the physical catalog name from the given logical name

Annotations
@Override
toPhysicalColumnNameback to summary
public Identifier toPhysicalColumnName(Identifier logicalName, JdbcEnvironment jdbcEnvironment)

Implements org.hibernate.boot.model.naming.PhysicalNamingStrategy.toPhysicalColumnName.

Doc from org.hibernate.boot.model.naming.PhysicalNamingStrategy.toPhysicalColumnName.

Determine the physical column name from the given logical name

Annotations
@Override
toPhysicalSchemaNameback to summary
public Identifier toPhysicalSchemaName(Identifier logicalName, JdbcEnvironment jdbcEnvironment)

Implements org.hibernate.boot.model.naming.PhysicalNamingStrategy.toPhysicalSchemaName.

Doc from org.hibernate.boot.model.naming.PhysicalNamingStrategy.toPhysicalSchemaName.

Determine the physical schema name from the given logical name

Annotations
@Override
toPhysicalSequenceNameback to summary
public Identifier toPhysicalSequenceName(Identifier logicalName, JdbcEnvironment jdbcEnvironment)

Implements org.hibernate.boot.model.naming.PhysicalNamingStrategy.toPhysicalSequenceName.

Doc from org.hibernate.boot.model.naming.PhysicalNamingStrategy.toPhysicalSequenceName.

Determine the physical sequence name from the given logical name

Annotations
@Override
toPhysicalTableNameback to summary
public Identifier toPhysicalTableName(Identifier logicalName, JdbcEnvironment jdbcEnvironment)

Implements org.hibernate.boot.model.naming.PhysicalNamingStrategy.toPhysicalTableName.

Doc from org.hibernate.boot.model.naming.PhysicalNamingStrategy.toPhysicalTableName.

Determine the physical table name from the given logical name

Annotations
@Override