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


Java PersistenceUnitInfo.getJtaDataSource方法代碼示例

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


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

示例1: createContainerEntityManagerFactory

import javax.persistence.spi.PersistenceUnitInfo; //導入方法依賴的package包/類
@Override
public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, Map map) {
   log.info("create container JdbcBridgeEntityManagerFactory");
   registerCibetDriver();

   logInfo(info, map);

   return new JdbcBridgeEntityManagerFactory(info.getJtaDataSource());

   // String err = this.getClass().getName() + " cannot be applied/injected in a container managed environment.";
   // log.error(err);
   // throw new IllegalStateException(err);
}
 
開發者ID:Wolfgang-Winter,項目名稱:cibet,代碼行數:14,代碼來源:JdbcBridgeProvider.java

示例2: getDataSource

import javax.persistence.spi.PersistenceUnitInfo; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public DataSource getDataSource() {
    PersistenceUnitInfo pui = internalFactoryBean.getPersistenceUnitInfo();
    if (internalFactoryBean.getPersistenceUnitInfo() != null) {
        return (pui.getJtaDataSource() != null ?
                pui.getJtaDataSource() :
                pui.getNonJtaDataSource());
    }
    return (persistenceUnitManager.getDefaultJtaDataSource() != null ?
            persistenceUnitManager.getDefaultJtaDataSource() :
            this.persistenceUnitManager.getDefaultDataSource());
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:16,代碼來源:KradEntityManagerFactoryBean.java

示例3: PersistenceUnitSwapDescriptor

import javax.persistence.spi.PersistenceUnitInfo; //導入方法依賴的package包/類
/**
    * Constructor with {@link PersistenceUnitInfoDescriptor} to set editable
    * properties
    * 
    * @param persistenceUnitInfo
    */
   public PersistenceUnitSwapDescriptor(PersistenceUnitInfo persistenceUnitInfo) {
super(persistenceUnitInfo);
this.nonJtaDataSource = persistenceUnitInfo.getNonJtaDataSource();
this.jtaDataSource = persistenceUnitInfo.getJtaDataSource();
this.managedClassNames = persistenceUnitInfo.getManagedClassNames();
   }
 
開發者ID:levants,項目名稱:lightmare,代碼行數:13,代碼來源:PersistenceUnitSwapDescriptor.java

示例4: 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


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