Class PhysicalNamingStrategyShogunCore
- java.lang.Object
-
- de.terrestris.shoguncore.util.naming.PhysicalNamingStrategyShogunCore
-
- All Implemented Interfaces:
Serializable,org.hibernate.boot.model.naming.PhysicalNamingStrategy
- Direct Known Subclasses:
OracleNamingStrategyShogunCore
public class PhysicalNamingStrategyShogunCore extends Object implements org.hibernate.boot.model.naming.PhysicalNamingStrategy, Serializable
Limits identifier length if necessary.- Author:
- Nils Bühner
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static intLENGTH_LIMIT_ORACLEprotected static intLENGTH_LIMIT_POSTGRESQL
-
Constructor Summary
Constructors Constructor Description PhysicalNamingStrategyShogunCore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.hibernate.boot.model.naming.IdentifierconvertToLimitedLowerCase(org.hibernate.engine.jdbc.env.spi.JdbcEnvironment context, org.hibernate.boot.model.naming.Identifier identifier, String prefix)Converts a givenIdentifierto the lower case representation.protected IntegergetIdentifierLengthLimit(org.hibernate.engine.jdbc.env.spi.JdbcEnvironment context)Determines the identifier length limit for the given JDBC context.StringgetTablePrefix()voidsetTablePrefix(String tablePrefix)org.hibernate.boot.model.naming.IdentifiertoPhysicalCatalogName(org.hibernate.boot.model.naming.Identifier name, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment jdbcEnvironment)org.hibernate.boot.model.naming.IdentifiertoPhysicalColumnName(org.hibernate.boot.model.naming.Identifier columnIdentifier, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment context)Converts column names to lower case and limits the length if necessary.org.hibernate.boot.model.naming.IdentifiertoPhysicalSchemaName(org.hibernate.boot.model.naming.Identifier name, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment jdbcEnvironment)org.hibernate.boot.model.naming.IdentifiertoPhysicalSequenceName(org.hibernate.boot.model.naming.Identifier name, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment jdbcEnvironment)org.hibernate.boot.model.naming.IdentifiertoPhysicalTableName(org.hibernate.boot.model.naming.Identifier tableIdentifier, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment context)Converts table names to lower case and limits the length if necessary.
-
-
-
Field Detail
-
LENGTH_LIMIT_ORACLE
protected static final int LENGTH_LIMIT_ORACLE
- See Also:
- Constant Field Values
-
LENGTH_LIMIT_POSTGRESQL
protected static final int LENGTH_LIMIT_POSTGRESQL
- See Also:
- Constant Field Values
-
-
Method Detail
-
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:
toPhysicalSequenceNamein interfaceorg.hibernate.boot.model.naming.PhysicalNamingStrategy
-
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:
toPhysicalCatalogNamein 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:
toPhysicalSchemaNamein interfaceorg.hibernate.boot.model.naming.PhysicalNamingStrategy
-
toPhysicalTableName
public org.hibernate.boot.model.naming.Identifier toPhysicalTableName(org.hibernate.boot.model.naming.Identifier tableIdentifier, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment context)Converts table names to lower case and limits the length if necessary.- Specified by:
toPhysicalTableNamein interfaceorg.hibernate.boot.model.naming.PhysicalNamingStrategy
-
toPhysicalColumnName
public org.hibernate.boot.model.naming.Identifier toPhysicalColumnName(org.hibernate.boot.model.naming.Identifier columnIdentifier, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment context)Converts column names to lower case and limits the length if necessary.- Specified by:
toPhysicalColumnNamein interfaceorg.hibernate.boot.model.naming.PhysicalNamingStrategy
-
convertToLimitedLowerCase
protected org.hibernate.boot.model.naming.Identifier convertToLimitedLowerCase(org.hibernate.engine.jdbc.env.spi.JdbcEnvironment context, org.hibernate.boot.model.naming.Identifier identifier, String prefix)Converts a givenIdentifierto the lower case representation. If the given context has a character limit for identifiers, this will be respected.- Parameters:
context- The JDBC contextidentifier- The identifierprefix- Optional prefix to use for the idenifiert. Will be ignored, if null- Returns:
-
getIdentifierLengthLimit
protected Integer getIdentifierLengthLimit(org.hibernate.engine.jdbc.env.spi.JdbcEnvironment context)
Determines the identifier length limit for the given JDBC context. Returns null if no limitation is necessary.- Parameters:
context- The current JDBC context- Returns:
- The identifier length limit for the given context. null otherwise.
-
getTablePrefix
public String getTablePrefix()
- Returns:
- the tablePrefix
-
setTablePrefix
public void setTablePrefix(String tablePrefix)
- Parameters:
tablePrefix- the tablePrefix to set
-
-