class SpringHibernateJpaPersistenceProvider extends HibernatePersistenceProvider {
@Override
@SuppressWarnings("rawtypes")
public EntityManagerFactory createContainerEntityManagerFactory(final PersistenceUnitInfo info, Map properties) {
return new EntityManagerFactoryBuilderImpl(new PersistenceUnitInfoDescriptor(info), properties) {
@Override
public Configuration buildHibernateConfiguration(ServiceRegistry serviceRegistry) {
Configuration configuration = super.buildHibernateConfiguration(serviceRegistry);
if (info instanceof SmartPersistenceUnitInfo) {
for (String managedPackage : ((SmartPersistenceUnitInfo) info).getManagedPackages()) {