當前位置: 首頁>>代碼示例>>Java>>正文


Java PersistenceUnitInfo.getTransactionType方法代碼示例

本文整理匯總了Java中javax.persistence.spi.PersistenceUnitInfo.getTransactionType方法的典型用法代碼示例。如果您正苦於以下問題:Java PersistenceUnitInfo.getTransactionType方法的具體用法?Java PersistenceUnitInfo.getTransactionType怎麽用?Java PersistenceUnitInfo.getTransactionType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.persistence.spi.PersistenceUnitInfo的用法示例。


在下文中一共展示了PersistenceUnitInfo.getTransactionType方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createProxy

import javax.persistence.spi.PersistenceUnitInfo; //導入方法依賴的package包/類
/**
 * Actually create the EntityManager proxy.
 * @param rawEntityManager raw EntityManager
 * @param emfInfo the EntityManagerFactoryInfo to obtain the
 * EntityManagerPlusOperations and PersistenceUnitInfo from
 * @param containerManaged whether to follow container-managed EntityManager
 * or application-managed EntityManager semantics
 * @return the EntityManager proxy
 */
private static EntityManager createProxy(
		EntityManager rawEntityManager, EntityManagerFactoryInfo emfInfo, boolean containerManaged) {

	Assert.notNull(emfInfo, "EntityManagerFactoryInfo must not be null");
	JpaDialect jpaDialect = emfInfo.getJpaDialect();
	EntityManagerPlusOperations plusOperations = null;
	if (jpaDialect != null && jpaDialect.supportsEntityManagerPlusOperations()) {
		plusOperations = jpaDialect.getEntityManagerPlusOperations(rawEntityManager);
	}
	PersistenceUnitInfo pui = emfInfo.getPersistenceUnitInfo();
	Boolean jta = (pui != null ? pui.getTransactionType() == PersistenceUnitTransactionType.JTA : null);
	return createProxy(rawEntityManager, emfInfo.getEntityManagerInterface(),
			emfInfo.getBeanClassLoader(), plusOperations, jpaDialect, jta, containerManaged);
}
 
開發者ID:deathspeeder,項目名稱:class-guard,代碼行數:24,代碼來源:ExtendedEntityManagerCreator.java

示例2: isJtaEnabled

import javax.persistence.spi.PersistenceUnitInfo; //導入方法依賴的package包/類
private boolean isJtaEnabled() throws Exception {
    EntityManagerFactoryDelegate delegate =
            entityManagerFactory.unwrap(EntityManagerFactoryDelegate.class);
    PersistenceUnitInfo info = delegate.getSetupImpl().getPersistenceUnitInfo();
    return info.getJtaDataSource() != null && info.getTransactionType() == PersistenceUnitTransactionType.JTA;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:7,代碼來源:KradEclipseLinkEntityManagerFactoryBeanTest.java

示例3: createProxy

import javax.persistence.spi.PersistenceUnitInfo; //導入方法依賴的package包/類
/**
 * Actually create the EntityManager proxy.
 * @param rawEntityManager raw EntityManager
 * @param emfInfo the EntityManagerFactoryInfo to obtain the JpaDialect
 * and PersistenceUnitInfo from
 * @param containerManaged whether to follow container-managed EntityManager
 * or application-managed EntityManager semantics
 * @param synchronizedWithTransaction whether to automatically join ongoing
 * transactions (according to the JPA 2.1 SynchronizationType rules)
 * @return the EntityManager proxy
 */
private static EntityManager createProxy(EntityManager rawEntityManager,
		EntityManagerFactoryInfo emfInfo, boolean containerManaged, boolean synchronizedWithTransaction) {

	Assert.notNull(emfInfo, "EntityManagerFactoryInfo must not be null");
	JpaDialect jpaDialect = emfInfo.getJpaDialect();
	PersistenceUnitInfo pui = emfInfo.getPersistenceUnitInfo();
	Boolean jta = (pui != null ? pui.getTransactionType() == PersistenceUnitTransactionType.JTA : null);
	return createProxy(rawEntityManager, emfInfo.getEntityManagerInterface(),
			emfInfo.getBeanClassLoader(), jpaDialect, jta, containerManaged, synchronizedWithTransaction);
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:22,代碼來源:ExtendedEntityManagerCreator.java


注:本文中的javax.persistence.spi.PersistenceUnitInfo.getTransactionType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。