Here is extract from Hibernate Book about naming strategies. I hope this will help you resolve you issue.
4.3.6 Implementing naming conventions
We often encounter organizations with strict conventions for database table and column names. Hibernate provides a feature that allows you to enforce naming standards automatically.
Suppose that all table names in CaveatEmptor should follow the pattern
CE_<table name>. One solution is to manually specify a table attribute on all <class> and collection elements in the mapping files. However, this approach is time-consuming and easily forgotten. Instead, you can implement Hibernate’s NamingStrategy interface, as in listing 4.1.
Code:
public class CENamingStrategy extends ImprovedNamingStrategy {
public String classToTableName(String className) {
return StringHelper.unqualify(className);
}
public String propertyToColumnName(String propertyName) {
return propertyName;
}
public String tableName(String tableName) {
return "CE_" + tableName;
}
public String columnName(String columnName) {
return columnName;
}
public String propertyToTableName(String className, String propertyName) {
return "CE_" + classToTableName(className) + '_'
+ propertyToColumnName(propertyName);
}
}
You extend the ImprovedNamingStrategy, which provides default implementations for all methods of NamingStrategy you don’t want to implement fromscratch (look at the API documentation and source). The classToTableName() method is called only if a <class> mapping doesn’t specify an explicit table name. The propertyToColumnName() method is called if a property has no explicit column name. The tableName() and columnName() methods are called when an explicit name is declared. If you enable this CENamingStrategy, the class mapping declaration
<class name="BankAccount"> results in CE_BANKACCOUNT as the name of the table. However, if a table name is specified, like this, <class name="BankAccount" table="BANK_ACCOUNT"> then CE_BANK_ACCOUNT is the name of the table. In this case, BANK_ACCOUNT is passed to the tableName() method.
So in your case read the prefix from your application properties and supply it to CENamingStrategy class.