if (emf == null) {
throw new IllegalArgumentException("'entityManagerFactory' or 'persistenceUnitName' is required");
}
Class[] ifcs = null;
if (emf instanceof EntityManagerFactoryInfo) {
EntityManagerFactoryInfo emfInfo = (EntityManagerFactoryInfo) emf;
if (this.entityManagerInterface == null) {
this.entityManagerInterface = emfInfo.getEntityManagerInterface();
if (this.entityManagerInterface == null) {
this.entityManagerInterface = EntityManager.class;
}
}
JpaDialect jpaDialect = emfInfo.getJpaDialect();
if (jpaDialect != null && jpaDialect.supportsEntityManagerPlusOperations()) {
ifcs = new Class[] {this.entityManagerInterface, EntityManagerPlus.class};
}
else {
ifcs = new Class[] {this.entityManagerInterface};