Hi,
I was trying to set up an ant task to create the schema using the ImprovedNamingStrategy class.
Code:
namingStrategy="org.hibernate.cfg.ImprovedNamingStrategy">
Since I was getting an exception (
Class org.hibernate.tool.hbm2ddl.SchemaExportTask can not access a member of class org.hibernate.cfg.ImprovedNamingStrategy with modifiers "protected"), I took a look at SchemaExport task. This is what it tries to do:
Code:
if (namingStrategy!=null) cfg.setNamingStrategy(
(NamingStrategy) ReflectHelper.classForName(namingStrategy).newInstance()
);
Unfortunately ImprovedNamingStrategy its a singleton and has the following constructor:
Code:
protected ImprovedNamingStrategy() {}
If this is a bug, could it be fixed ? Since the constructor is protected at least you can extend it with an empty class and use it as the NamingStrategy, but this is just a hack and not something you want to keep in your codebase.
Best regards,
- Juan