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

org.jlot.hibernate.orm.JlotNamingStrategy Maven / Gradle / Ivy

There is a newer version: 1.2
Show newest version
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();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy