All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.avaje.ebean.config.MatchingNamingConvention Maven / Gradle / Ivy

There is a newer version: 8.1.1
Show newest version
package com.avaje.ebean.config;

/**
 * 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 */ public class MatchingNamingConvention extends AbstractNamingConvention { /** * Create with a sequence format of "{table}_seq". */ public MatchingNamingConvention() { super(); } /** * Instantiates with a specific format for DB sequences. * * @param sequenceFormat * the sequence format */ public MatchingNamingConvention(String sequenceFormat) { super(sequenceFormat); } public String getColumnFromProperty(Class beanClass, String propertyName) { return propertyName; } public TableName getTableNameByConvention(Class beanClass) { return new TableName(getCatalog(), getSchema(), beanClass.getSimpleName()); } public String getPropertyFromColumn(Class beanClass, String dbColumnName) { return dbColumnName; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy