本文整理了Java中javax.persistence.Persistence.findAllProviders()
方法的一些代码示例,展示了Persistence.findAllProviders()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Persistence.findAllProviders()
方法的具体详情如下:
包路径:javax.persistence.Persistence
类名称:Persistence
方法名:findAllProviders
暂无
代码示例来源:origin: javax.persistence/persistence-api
providersFound = findAllProviders();
} catch (IOException exc){};
代码示例来源:origin: org.jboss.javaee/jboss-persistence-api
/**
* Create and return an EntityManagerFactory for the named persistence unit using the given properties.
*
* @param persistenceUnitName The name of the persistence unit
* @param properties Additional properties to use when creating the factory. The values of these properties override
* any values that may have been configured elsewhere
* @return The factory that creates EntityManagers configured according to the specified persistence unit
*/
public static EntityManagerFactory createEntityManagerFactory(String persistenceUnitName, Map properties) {
EntityManagerFactory emf = null;
if ( providers.size() == 0 ) {
findAllProviders();
}
for ( PersistenceProvider provider : providers ) {
emf = provider.createEntityManagerFactory( persistenceUnitName, properties );
if ( emf != null ) break;
}
if ( emf == null ) {
throw new PersistenceException( "No Persistence provider for EntityManager named " + persistenceUnitName );
}
return emf;
}
代码示例来源:origin: toplink.essentials/toplink-essentials
providersFound = findAllProviders();
} catch (IOException exc){};
内容来源于网络,如有侵权,请联系作者删除!