In my Spring Data JDBC project I have custom NamingStrategy (predefined prefix is added to entity name):
private static final String TABLE_NAME_PREFIX = "foo_";
@Bean
public NamingStrategy namingStrategy() {
return new NamingStrategy() {
@Override
public String getTableName(Class<?> type) {
Assert.notNull(type, "Type must not be null");
return TABLE_NAME_PREFIX + ParsingUtils.reconcatenateCamelCase(type.getSimpleName(), "_");
}
};
}
I want to have the same table names generated by AnnotationProcessor in Q-classes.
What is recommended way to adjust it in AnnotationProcessor?
It seems that enough should be:
- writing my own ExtendedTypeFactory implementation which extends CustomExtendedTypeFactory and overrides one method: getTableNameEntityType model).
- overriding createTypeFactory method of SpringDataJdbcAnnotationProcessorBase and use implementation of ExtendedTypeFactory (created in first step) instead of CustomExtendedTypeFactory
But it turns out it is impossible due to CustomExtendedTypeFactory class visibility issue. What is the reason this class is not an public class?
In my Spring Data JDBC project I have custom NamingStrategy (predefined prefix is added to entity name):
I want to have the same table names generated by AnnotationProcessor in Q-classes.
What is recommended way to adjust it in AnnotationProcessor?
It seems that enough should be:
But it turns out it is impossible due to CustomExtendedTypeFactory class visibility issue. What is the reason this class is not an public class?