@SuppressWarnings("rawtypes")
public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, Map properties) {
Ejb3Configuration cfg = new Ejb3Configuration();
if (info instanceof SmartPersistenceUnitInfo) {
for (String managedPackage : ((SmartPersistenceUnitInfo) info).getManagedPackages()) {
cfg.addPackage(managedPackage);
}
}
Ejb3Configuration configured = cfg.configure(info, properties);
return (configured != null ? configured.buildEntityManagerFactory() : null);
}