public abstract class AbstractNamingFactory extends Object implements NamingFactory
| Modifier and Type | Field and Description |
|---|---|
protected ClassLoaderResolver |
clr |
protected NamingCase |
namingCase |
protected NucleusContext |
nucCtx |
protected String |
quoteString
Quote used when the identifier case selected requires it.
|
protected String |
wordSeparator
Separator to use for words in the identifiers.
|
| Constructor and Description |
|---|
AbstractNamingFactory(NucleusContext nucCtx) |
| Modifier and Type | Method and Description |
|---|---|
String |
getColumnName(AbstractMemberMetaData mmd,
ColumnType type)
Method to return the name of the column for the specified field.
|
protected int |
getMaximumLengthForComponent(SchemaComponent cmpt) |
protected String |
getNameInRequiredCase(String name)
Convenience method to convert the passed name into a name in the required "case".
|
String |
getTableName(AbstractClassMetaData cmd)
Method to return the name of the table for the specified class.
|
protected String |
prepareColumnNameForUse(String name) |
NamingFactory |
setMaximumLength(SchemaComponent cmpt,
int max)
Method to set the maximum length of the name of the specified schema component.
|
NamingFactory |
setNamingCase(NamingCase nameCase)
Method to set the required case of the names.
|
NamingFactory |
setQuoteString(String quote)
Method to set the quote string to use (when the identifiers need to be quoted).
|
NamingFactory |
setWordSeparator(String sep)
Method to set the word separator of the names.
|
protected static String |
truncate(String name,
int length)
Method to truncate a name to fit within the specified name length.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetColumnName, getColumnName, getTableNameprotected String wordSeparator
protected String quoteString
protected NamingCase namingCase
protected NucleusContext nucCtx
protected ClassLoaderResolver clr
public AbstractNamingFactory(NucleusContext nucCtx)
public NamingFactory setQuoteString(String quote)
NamingFactorysetIdentifierCase.
setQuoteString in interface NamingFactoryquote - The quote stringpublic NamingFactory setWordSeparator(String sep)
NamingFactorysetWordSeparator in interface NamingFactorysep - Separatorpublic NamingFactory setNamingCase(NamingCase nameCase)
NamingFactorysetNamingCase in interface NamingFactorynameCase - Required casepublic NamingFactory setMaximumLength(SchemaComponent cmpt, int max)
NamingFactorysetMaximumLength in interface NamingFactorycmpt - The componentmax - The maximum it acceptsprotected int getMaximumLengthForComponent(SchemaComponent cmpt)
public String getTableName(AbstractClassMetaData cmd)
NamingFactorygetTableName in interface NamingFactorycmd - Metadata for the classpublic String getColumnName(AbstractMemberMetaData mmd, ColumnType type)
NamingFactorygetColumnNamemethod.
getColumnName in interface NamingFactorymmd - Metadata for the fieldtype - Type of columnprotected static String truncate(String name, int length)
TRUNCATE_HASH_LENGTH) (at the end) to attempt
to create uniqueness.name - The namelength - The (max) length to useprotected String getNameInRequiredCase(String name)
name - The nameCopyright © 2013. All Rights Reserved.