当前位置: 首页>>代码示例>>Java>>正文


Java PersistenceUnitInfo.getNonJtaDataSource方法代码示例

本文整理汇总了Java中javax.persistence.spi.PersistenceUnitInfo.getNonJtaDataSource方法的典型用法代码示例。如果您正苦于以下问题:Java PersistenceUnitInfo.getNonJtaDataSource方法的具体用法?Java PersistenceUnitInfo.getNonJtaDataSource怎么用?Java PersistenceUnitInfo.getNonJtaDataSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.persistence.spi.PersistenceUnitInfo的用法示例。


在下文中一共展示了PersistenceUnitInfo.getNonJtaDataSource方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: resolveDataSource

import javax.persistence.spi.PersistenceUnitInfo; //导入方法依赖的package包/类
private DataSource resolveDataSource(PersistenceUnitInfo info) {
   String url = null;
   String user = null;
   String password = null;

   if (info.getProperties().containsKey(HIBERNATE_URL)) {
      url = info.getProperties().getProperty(HIBERNATE_URL);
      user = info.getProperties().getProperty(HIBERNATE_USER);
      password = info.getProperties().getProperty(HIBERNATE_PASSWORD);
      return new DefaultDataSource(url, user, password);
   }

   if (info.getProperties().containsKey(JAVAX_URL)) {
      url = info.getProperties().getProperty(JAVAX_URL);
      user = info.getProperties().getProperty(JAVAX_USER);
      password = info.getProperties().getProperty(JAVAX_PASSWORD);
      return new DefaultDataSource(url, user, password);
   }

   return info.getNonJtaDataSource();
}
 
开发者ID:Wolfgang-Winter,项目名称:cibet,代码行数:22,代码来源: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


注:本文中的javax.persistence.spi.PersistenceUnitInfo.getNonJtaDataSource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。