/**
* <P>PROJECT:COM.MIDEA.JR.ECF <p>
* <p>module:meloans.utils <p>
* <p>description: Table column name turns to uppercase <p>
*
* @author WANGZY25
* @date September 20, 2016 PM 5:35:15
* * Public
class Namingstrategy extends improvednamingstrategy{
/** */
private static final long Serialversionuid = 1L;
@Override public
string TableName (String tableName) {
return tablename.touppercase ();
}
@Override public
string ColumnName (String columnName) {
return Super.columnname (columnName). toUpperCase () ;
}
@Override public
string Propertytocolumnname (String propertyname) {
return super.propertytocolumnname ( PropertyName). toUpperCase ();
}
}
Configuration in Entitymanagerfactory:
<prop key= "Hibernate.ejb.naming_strategy" >com.midea.jr.ecf.meloans.utils.NamingStrategy</prop>
<property name= "Jpaproperties" > <props> <prop key= "Hibernate.dialect" >${hibernate.dialect}</p rop> <prop key= "Hibernate.ejb.naming_strategy" >com.midea.jr.ecf.meloans.utils.namingstrategy</prop > <prop key= "Hibernate.cache.use_second_level_cache" >${hibernate.cache.use_second_level_cache}</prop
> <prop key= "Hibernate.cache.region.factory_class" >${hibernate.cache.region.factory_class}</prop> <prop key= "Hibernate.cache.use_query_cache" >${hibernate.cache.use_query_cache}</prop> <prop key= " Hibernate.jdbc.fetch_size ">${hibernate.jdbc.fetch_size}</prop> <prop key=" Hibernate.jdbc.batch_size " >${hibernate.jdbc.batch_size}</prop> <prop key= "Hibernate.hbm2ddl.auto" >update</prop> <PR Op key= "Hibernate.show_sql" >true</prop> <prop key= "Hibernate.format_sql" >true</prop> <prop key= "Hibernate.use_sql_comments" >FALSE</PROP> <prop key= "hibernate.connection.isolation" >2</prop> <prop key= "Javax.persistence.validation.mode" >none</prop> </props> </property>
Reference: Hibernate mapping field issues [Improvednamingstrategy]
http://blog.csdn.net/dracotianlong/article/details/27834143
Hibernate Create a naming policy
Http://www.cnblogs.com/wangyong/p/Hibernate.html