|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.avaje.ebean.config.AbstractNamingConvention com.avaje.ebean.config.UnderscoreNamingConvention
public class UnderscoreNamingConvention
Converts between Camel Case and Underscore based names for both table and column names (and is the default naming convention in Ebean).
Field Summary |
---|
Fields inherited from class com.avaje.ebean.config.AbstractNamingConvention |
---|
DEFAULT_SEQ_FORMAT |
Constructor Summary | |
---|---|
UnderscoreNamingConvention()
Create with a sequence format of "{table}_seq". |
|
UnderscoreNamingConvention(String sequenceFormat)
Create with a given sequence format. |
Method Summary | |
---|---|
String |
getColumnFromProperty(Class<?> beanClass,
String propertyName)
Converts Camel case property name to underscore based column name. |
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. |
Methods inherited from class com.avaje.ebean.config.AbstractNamingConvention |
---|
getCatalog, getM2MJoinTableName, getSchema, getSequenceFormat, getSequenceName, getTableName, isUseForeignKeyPrefix, setCatalog, setDatabasePlatform, setSchema, setSequenceFormat, setUseForeignKeyPrefix |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UnderscoreNamingConvention(String sequenceFormat)
sequenceFormat
- the sequence formatpublic UnderscoreNamingConvention()
Method Detail |
---|
public TableName getTableNameByConvention(Class<?> beanClass)
beanClass
- the bean class
public String getColumnFromProperty(Class<?> beanClass, String propertyName)
public String getPropertyFromColumn(Class<?> beanClass, String dbColumnName)
beanClass
- the bean classdbColumnName
- the db column name
public boolean isForceUpperCase()
False if it will be lower case.
public void setForceUpperCase(boolean forceUpperCase)
public boolean isDigitsCompressed()
public void setDigitsCompressed(boolean digitsCompressed)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |