com.mysema.query.sql
Class DefaultNamingStrategy

java.lang.Object
  extended by com.mysema.query.sql.DefaultNamingStrategy
All Implemented Interfaces:
NamingStrategy

public class DefaultNamingStrategy
extends Object
implements NamingStrategy

DefaultNamingStrategy is the default implementation of the NamingStrategy interface

Author:
tiwe

Constructor Summary
DefaultNamingStrategy()
           
DefaultNamingStrategy(String reservedSuffix)
           
 
Method Summary
 String getClassName(String namePrefix, String tableName)
          Convert the given tableName to a simple class name with the given name prefix
 String getDefaultAlias(String namePrefix, EntityType entityType)
          Get the default alias for the given EntityType
 String getDefaultVariableName(String namePrefix, EntityType entityType)
          Get the default variable name for the given EntityType
 String getPropertyName(String columnName, String namePrefix, EntityType entityType)
          Convert the given column name to a property name
 String getPropertyNameForForeignKey(String foreignKeyName, EntityType entityType)
          Convert the given foreign key name to a foreign key property name
 String getPropertyNameForInverseForeignKey(String foreignKeyName, EntityType entityType)
          Convert the given foreign key name to a foreign key property name
 String getPropertyNameForPrimaryKey(String primaryKeyName, 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
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultNamingStrategy

public DefaultNamingStrategy()

DefaultNamingStrategy

public DefaultNamingStrategy(String reservedSuffix)
Method Detail

getClassName

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

Specified by:
getClassName in interface NamingStrategy
Returns:

getDefaultAlias

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

Specified by:
getDefaultAlias in interface NamingStrategy
Returns:

getDefaultVariableName

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

Specified by:
getDefaultVariableName in interface NamingStrategy
Returns:

getPropertyName

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

Specified by:
getPropertyName in interface NamingStrategy
namePrefix - NOTE : is used in some custom NamingStrategy implementations
Returns:

getPropertyNameForForeignKey

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

Specified by:
getPropertyNameForForeignKey in interface NamingStrategy
Returns:

getPropertyNameForInverseForeignKey

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

Specified by:
getPropertyNameForInverseForeignKey in interface NamingStrategy
Returns:

getPropertyNameForPrimaryKey

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

Specified by:
getPropertyNameForPrimaryKey in interface NamingStrategy
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

Specified by:
normalizeColumnName in interface NamingStrategy
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

Specified by:
normalizeTableName in interface NamingStrategy
Returns:

toCamelCase

protected String toCamelCase(String str)


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