java.lang.Object
io.ebean.config.AbstractNamingConvention
io.ebean.config.MatchingNamingConvention
- All Implemented Interfaces:
NamingConvention
The JPA naming convention where column names match property names and table
names match entity names.
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.
- Author:
- emcgreal
-
Field Summary
Fields inherited from class io.ebean.config.AbstractNamingConvention
databasePlatform, DEFAULT_SEQ_FORMAT, rhsPrefixLength, useForeignKeyPrefix
-
Constructor Summary
ConstructorDescriptionCreate with a sequence format of "{table}_seq".MatchingNamingConvention
(String sequenceFormat) Instantiates with a specific format for DB sequences. -
Method Summary
Modifier and TypeMethodDescriptiongetColumnFromProperty
(Class<?> beanClass, String propertyName) Return the column name given the property name.getForeignKey
(String prefix, String fkProperty) Return the foreign key column given the local and foreign properties.getTableNameByConvention
(Class<?> beanClass) Return the tableName using the naming convention (rather than deployed Table annotation).Methods inherited from class io.ebean.config.AbstractNamingConvention
deriveM2MColumn, getCatalog, getM2MJoinTableName, getSchema, getSequenceFormat, getSequenceName, getTableName, getTableName, getTableNameFromAnnotation, hasInheritance, isEmpty, isUseForeignKeyPrefix, loadFromProperties, quoteIdentifiers, setCatalog, setDatabasePlatform, setSchema, setSequenceFormat, setUseForeignKeyPrefix
-
Constructor Details
-
MatchingNamingConvention
public MatchingNamingConvention()Create with a sequence format of "{table}_seq". -
MatchingNamingConvention
Instantiates with a specific format for DB sequences.- Parameters:
sequenceFormat
- the sequence format
-
-
Method Details
-
getColumnFromProperty
Description copied from interface:NamingConvention
Return the column name given the property name.- Returns:
- the column name for a given property
-
getTableNameByConvention
Description copied from class:AbstractNamingConvention
Return the tableName using the naming convention (rather than deployed Table annotation).- Specified by:
getTableNameByConvention
in classAbstractNamingConvention
-
getForeignKey
Description copied from interface:NamingConvention
Return the foreign key column given the local and foreign properties.- Parameters:
prefix
- the local column used to prefix the fk columnfkProperty
- the property name of the foreign key- Returns:
- the foreign key column
-