Code example for EJB3NamingStrategy

0
//$Id$ 
package org.hibernate.test.annotations; 
import org.hibernate.cfg.EJB3NamingStrategy;
import org.hibernate.cfg.NamingStrategy;
import org.hibernate.internal.util.StringHelper;
 
/** 
 * @author Emmanuel Bernard 
 */ 
public class AlternativeNamingStrategy extends EJB3NamingStrategy {
	public static NamingStrategy INSTANCE = new AlternativeNamingStrategy();
 
	public String classToTableName(String className) {
		return tableName( StringHelper.unqualify( className ) );
	} 
 
	public String propertyToColumnName(String propertyName) {
		return columnName( StringHelper.unqualify( propertyName ) );
	} 
 
	public String tableName(String tableName) {
		return "table_" + tableName;
	}