public class MatchingNamingConvention extends AbstractNamingConvention
The JPA specification states that the in the case of no annotations the name of the class will be take as the table name and the name of a property will be taken as the name of the column.
databasePlatform, DEFAULT_SEQ_FORMAT, rhsPrefixLength, TABLE_PKCOLUMN_SEQ_FORMAT, useForeignKeyPrefix| Constructor and Description |
|---|
MatchingNamingConvention()
Create with a sequence format of "{table}_seq".
|
MatchingNamingConvention(String sequenceFormat)
Instantiates with a specific format for DB sequences.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getColumnFromProperty(Class<?> beanClass,
String propertyName)
Return the column name given the property name.
|
String |
getPropertyFromColumn(Class<?> beanClass,
String dbColumnName)
Return the property name from the column name.
|
TableName |
getTableNameByConvention(Class<?> beanClass)
Return the tableName using the naming convention (rather than deployed
Table annotation).
|
findTableAnnotation, getCatalog, getM2MJoinTableName, getSchema, getSequenceFormat, getSequenceName, getTableName, getTableNameFromAnnotation, isEmpty, isUseForeignKeyPrefix, loadFromProperties, quoteIdentifiers, setCatalog, setDatabasePlatform, setSchema, setSequenceFormat, setUseForeignKeyPrefixpublic MatchingNamingConvention()
public MatchingNamingConvention(String sequenceFormat)
sequenceFormat - the sequence formatpublic String getColumnFromProperty(Class<?> beanClass, String propertyName)
NamingConventionpublic TableName getTableNameByConvention(Class<?> beanClass)
AbstractNamingConventiongetTableNameByConvention in class AbstractNamingConventionpublic String getPropertyFromColumn(Class<?> beanClass, String dbColumnName)
NamingConventionThis is used to help mapping of raw SQL queries onto bean properties.
beanClass - the bean classdbColumnName - the db column nameCopyright © 2016. All rights reserved.