com.mysema.query.sql
Class DefaultNamingStrategy

java.lang.Object
  extended by com.mysema.query.sql.AbstractNamingStrategy
      extended by com.mysema.query.sql.DefaultNamingStrategy
All Implemented Interfaces:
NamingStrategy
Direct Known Subclasses:
ExtendedNamingStrategy

public class DefaultNamingStrategy
extends AbstractNamingStrategy

DefaultNamingStrategy is the default implementation of the NamingStrategy interface. It changes underscore usage into camel case form.

Author:
tiwe

Field Summary
 
Fields inherited from class com.mysema.query.sql.AbstractNamingStrategy
foreignKeysClassName, foreignKeysVariable, primaryKeysClassName, primaryKeysVariable, reservedSuffix
 
Constructor Summary
DefaultNamingStrategy()
           
 
Method Summary
protected  String escape(EntityType entityType, String name)
           
 String getClassName(String tableName)
          Convert the given tableName to a simple class name
 String getDefaultAlias(EntityType entityType)
          Get the default alias for the given EntityType
 String getDefaultVariableName(EntityType entityType)
          Get the default variable name for the given EntityType
 String getForeignKeysVariable(EntityType entityType)
          Get the field name for the foreign keys class instance
 String getPrimaryKeysVariable(EntityType entityType)
          Get the field name for the primary keys class instance
 String getPropertyName(String columnName, EntityType entityType)
          Convert the given column name to a property name
 String getPropertyNameForForeignKey(String fkName, EntityType entityType)
          Convert the given foreign key name to a foreign key property name
 String getPropertyNameForInverseForeignKey(String fkName, EntityType entityType)
          Convert the given foreign key name to a foreign key property name
 String getPropertyNameForPrimaryKey(String pkName, EntityType entityType)
          Convert the given primary key name to a primary key property name
 String normalizeColumnName(String columnName)
          Convert the given column name and provide the opportunity to add quoted identifiers
protected  String normalizePropertyName(String name)
           
 String normalizeSchemaName(String schemaName)
          Convert the given schema name and provide the opportunity to add quoted identifiers
 String normalizeTableName(String tableName)
          Convert the given table name and provide the opportunity to add quoted identifiers
protected  String toCamelCase(String str)
           
 
Methods inherited from class com.mysema.query.sql.AbstractNamingStrategy
getForeignKeysClassName, getPrimaryKeysClassName, setForeignKeysClassName, setForeignKeysVariable, setPrimaryKeysClassName, setPrimaryKeysVariable, setReservedSuffix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultNamingStrategy

public DefaultNamingStrategy()
Method Detail

getClassName

public String getClassName(String tableName)
Description copied from interface: NamingStrategy
Convert the given tableName to a simple class name

Returns:

getDefaultAlias

public String getDefaultAlias(EntityType entityType)
Description copied from interface: NamingStrategy
Get the default alias for the given EntityType

Returns:

getDefaultVariableName

public String getDefaultVariableName(EntityType entityType)
Description copied from interface: NamingStrategy
Get the default variable name for the given EntityType

Returns:

getForeignKeysVariable

public String getForeignKeysVariable(EntityType entityType)
Description copied from interface: NamingStrategy
Get the field name for the foreign keys class instance

Specified by:
getForeignKeysVariable in interface NamingStrategy
Overrides:
getForeignKeysVariable in class AbstractNamingStrategy
Returns:

getPrimaryKeysVariable

public String getPrimaryKeysVariable(EntityType entityType)
Description copied from interface: NamingStrategy
Get the field name for the primary keys class instance

Specified by:
getPrimaryKeysVariable in interface NamingStrategy
Overrides:
getPrimaryKeysVariable in class AbstractNamingStrategy
Returns:

getPropertyName

public String getPropertyName(String columnName,
                              EntityType entityType)
Description copied from interface: NamingStrategy
Convert the given column name to a property name

Returns:

getPropertyNameForForeignKey

public String getPropertyNameForForeignKey(String fkName,
                                           EntityType entityType)
Description copied from interface: NamingStrategy
Convert the given foreign key name to a foreign key property name

Returns:

getPropertyNameForInverseForeignKey

public String getPropertyNameForInverseForeignKey(String fkName,
                                                  EntityType entityType)
Description copied from interface: NamingStrategy
Convert the given foreign key name to a foreign key property name

Returns:

getPropertyNameForPrimaryKey

public String getPropertyNameForPrimaryKey(String pkName,
                                           EntityType entityType)
Description copied from interface: NamingStrategy
Convert the given primary key name to a primary key property name

Returns:

normalizeColumnName

public String normalizeColumnName(String columnName)
Description copied from interface: NamingStrategy
Convert the given column name and provide the opportunity to add quoted identifiers

Returns:

normalizeTableName

public String normalizeTableName(String tableName)
Description copied from interface: NamingStrategy
Convert the given table name and provide the opportunity to add quoted identifiers

Returns:

normalizeSchemaName

public String normalizeSchemaName(String schemaName)
Description copied from interface: NamingStrategy
Convert the given schema name and provide the opportunity to add quoted identifiers

Returns:

normalizePropertyName

protected String normalizePropertyName(String name)

escape

protected String escape(EntityType entityType,
                        String name)

toCamelCase

protected String toCamelCase(String str)


Copyright © 2007-2011 Mysema Ltd. All Rights Reserved.