org.makumba.commons
Class NameResolver
java.lang.Object
org.makumba.commons.NameResolver
- Direct Known Subclasses:
- NameResolverHook
public class NameResolver
- extends Object
This class provides utility methods to convert names from MDD types into their name in the data source. It also takes
into account properties passed in the database configuration.
TODO document these properties
- Version:
- $Id: NameResolver.java 5156 2010-05-18 22:14:06Z rosso_nero $
- Author:
- Manuel Gay, Cristian Bogdan
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fieldDBNames
protected HashMap<String,HashMap<String,String>> fieldDBNames
NameResolver
public NameResolver()
NameResolver
public NameResolver(Properties configurationProperties)
getKey
public String getKey()
resolveTypeName
public String resolveTypeName(DataDefinition dd)
- Resolves the database level name for a type, based on Makumba business rules and specific configuration done by
the user.
- Parameters:
dd
- the DataDefinition
corresponding to the type to resolve
- Returns:
- the database level name for this type
resolveFieldName
public String resolveFieldName(DataDefinition dd,
String fieldName)
- Resolves the database level name for a field, based on Makumba business rules and specific configuration done by
the user.
- Parameters:
dd
- the DataDefinition
corresponding to the type of the field to resolvefieldName
- the name of the field to resolve
- Returns:
- the database level name for this field
getTableNameFromConfig
public String getTableNameFromConfig(Properties config,
DataDefinition dd)
- Finds the shortest possible table name, according to what is defined in the configuration with rule and table:
general.Person = gp general.Person->fields will create table _gp__fields_ instead of _general_Person__fields_ as
it did before
- Parameters:
config
- the configuration Properties
dd
- the DataDefinition
corresponding to the type
- Returns:
- the name of the table as specified in the configuration
dotToUnderscore
public String dotToUnderscore(String name)
arrowToDot
public String arrowToDot(String name)
arrowToDoubleDot
public String arrowToDoubleDot(String name)
arrowToDoubleUnderscore
public String arrowToDoubleUnderscore(String name)
checkReserved
public String checkReserved(String name)
mddToSQLName
public String mddToSQLName(String name)