Hi,
I have stumbled upon the same problem multiple times in the last years so I finally decided to ask for a solution here. I have often had requirement to prefix column names for persistent classes to names which include the table name in some form as a prefix. For example the class could look like this:
Code:
class Requests {
long id;
String name;
}
and should be mapped to a relation named T_REQUESTS with columns REQ_ID and REQ_NAME (tableName := "T_" + camelToUpperUnderscoreCase(className); columnName := className.substring(0,3) + "_" + camelToUpperUnderscoreCase(propertyName)). This is unfortunately impossible (AFAIK) using the current NamingStrategy interface which does not provide the class name to the method which must determine the name of the column. Is there another way to achieve this (in an automated fashion and not by specifying each name)? Do you plan to enhance the naming strategy with this data which is available in the caller of naming strategy?
Best regards,
Dimo