Hello Hibernate team,
it does not seem possible to easily set up a PhysicalNamingStrategy from a property files.
I am in a Spring environment, so the following occurs.
A configuration instance is created (from org.hibernate.cfg.Configuration#Configuration(org.hibernate.boot.registry.BootstrapServiceRegistry))
the Session factory is built through org.hibernate.cfg.Configuration#buildSessionFactory(org.hibernate.service.ServiceRegistry)
In that context, all information regarding regarding PhysicalNamingStrategy are correctly extracted from the service registry, while creating the metadataBuilder.
However, it then hits the line testing if physicalNamingStrategy is already defined in Configuration instance. As all constructor calls #reset(), that sets physicalNamingStrategy to PhysicalNamingStrategyStandardImpl.INSTANCE, it is never null, and client configuration previously set is always overridden.
I can confirm this issue against 5.2.10.Final. I do configuration using a hibernate.cfg.xml which works in principle (application connects to database, so hibernate reads the configuration at least).
I tried to override methods from PhysicalNamingStrategyStandardImpl via hibernate.cfg.xml with
Using a step debugger, I figured out hibernate still uses PhysicalNamingStrategyStandardImpl because its methods were executed whereas the overriding methods were not.
Hibernate also reads the configuration variables in principle and tries to use them for a naming strategy (When I intentionally do something wrong, Hibernate tells me that something goes wrong with the strategy).