public class UnderscoreNamingConvention extends AbstractNamingConvention
DEFAULT_SEQ_FORMAT
Constructor and Description |
---|
UnderscoreNamingConvention()
Create with a sequence format of "{table}_seq".
|
UnderscoreNamingConvention(String sequenceFormat)
Create with a given sequence format.
|
Modifier and Type | Method and Description |
---|---|
String |
getColumnFromProperty(Class<?> beanClass,
String propertyName)
Converts Camel case property name to underscore based column name.
|
String |
getForeignKey(String prefix,
String fkProperty)
Return the foreign key column given the local and foreign properties.
|
String |
getPropertyFromColumn(Class<?> beanClass,
String dbColumnName)
Converts underscore based column name to Camel case property name.
|
TableName |
getTableNameByConvention(Class<?> beanClass)
Returns the last part of the class name.
|
boolean |
isDigitsCompressed()
Returns true if digits are compressed.
|
boolean |
isForceUpperCase()
Return true if the result will be upper case.
|
void |
setDigitsCompressed(boolean digitsCompressed)
Sets to true for digits to be compressed (without a leading underscore).
|
void |
setForceUpperCase(boolean forceUpperCase)
Set to true to make the result upper case.
|
getCatalog, getM2MJoinTableName, getSchema, getSequenceFormat, getSequenceName, getTableName, isUseForeignKeyPrefix, loadFromProperties, setCatalog, setDatabasePlatform, setSchema, setSequenceFormat, setUseForeignKeyPrefix
public UnderscoreNamingConvention(String sequenceFormat)
sequenceFormat
- the sequence formatpublic UnderscoreNamingConvention()
public TableName getTableNameByConvention(Class<?> beanClass)
beanClass
- the bean classpublic String getColumnFromProperty(Class<?> beanClass, String propertyName)
public String getPropertyFromColumn(Class<?> beanClass, String dbColumnName)
beanClass
- the bean classdbColumnName
- the db column namepublic boolean isForceUpperCase()
False if it will be lower case.
public void setForceUpperCase(boolean forceUpperCase)
public boolean isDigitsCompressed()
public void setDigitsCompressed(boolean digitsCompressed)
public String getForeignKey(String prefix, String fkProperty)
NamingConvention
prefix
- the local column used to prefix the fk columnfkProperty
- the property name of the foreign keyCopyright © 2019. All rights reserved.