com.mysema.query.sql
Class ExtendedNamingStrategy

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

public class ExtendedNamingStrategy
extends DefaultNamingStrategy

ExtendedNamingStrategy works like the DefaultNamingStrategy but tries to create foreign key property names in a different way. It looks for patterns like this .*_<forward>_<inverse> and uses the forward part for the foreign key name and inverse for the inverse foreign key name.

Author:
tiwe

Field Summary
 
Fields inherited from class com.mysema.query.sql.AbstractNamingStrategy
foreignKeysClassName, foreignKeysVariable, primaryKeysClassName, primaryKeysVariable, reservedSuffix
 
Constructor Summary
ExtendedNamingStrategy()
           
 
Method Summary
 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
 
Methods inherited from class com.mysema.query.sql.DefaultNamingStrategy
escape, getClassName, getDefaultAlias, getDefaultVariableName, getForeignKeysVariable, getPrimaryKeysVariable, getPropertyName, getPropertyNameForPrimaryKey, normalizeColumnName, normalizePropertyName, normalizeSchemaName, normalizeTableName, toCamelCase
 
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

ExtendedNamingStrategy

public ExtendedNamingStrategy()
Method Detail

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

Specified by:
getPropertyNameForForeignKey in interface NamingStrategy
Overrides:
getPropertyNameForForeignKey in class DefaultNamingStrategy
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

Specified by:
getPropertyNameForInverseForeignKey in interface NamingStrategy
Overrides:
getPropertyNameForInverseForeignKey in class DefaultNamingStrategy
Returns:


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