org.jlot.hibernate.orm.JlotNamingStrategy Maven / Gradle / Ivy
package org.jlot.hibernate.orm;
import org.hibernate.cfg.DefaultComponentSafeNamingStrategy;
public class JlotNamingStrategy extends DefaultComponentSafeNamingStrategy
{
private static final long serialVersionUID = 1L;
private String currentTableName;
@Override
public String tableName ( String tableName )
{
currentTableName = super.tableName(tableName);
return currentTableName;
}
@Override
public String classToTableName ( String className )
{
currentTableName = super.classToTableName(className).toLowerCase();
return currentTableName;
}
@Override
public String propertyToColumnName ( String propertyName )
{
return currentTableName + "_" + super.propertyToColumnName(propertyName).toLowerCase();
}
}