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


Java JpaTransactionManager.setJpaDialect方法代码示例

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


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

示例1: transactionManager

import org.springframework.orm.jpa.JpaTransactionManager; //导入方法依赖的package包/类
@Bean
@Autowired
public JpaTransactionManager transactionManager(EntityManagerFactory entityManagerFactory) {
    JpaTransactionManager txManager = new JpaTransactionManager();
    JpaDialect jpaDialect = new HibernateJpaDialect();
    txManager.setEntityManagerFactory(entityManagerFactory);
    txManager.setJpaDialect(jpaDialect);
    return txManager;
}
 
开发者ID:VHAINNOVATIONS,项目名称:BCDS,代码行数:10,代码来源:DatabaseConfiguration.java

示例2: createTransactionManager

import org.springframework.orm.jpa.JpaTransactionManager; //导入方法依赖的package包/类
private PlatformTransactionManager createTransactionManager() {
    final JpaTransactionManager jpaTransactionManager = new JpaTransactionManager();
    jpaTransactionManager.setEntityManagerFactory(getEntityManagerFactory());
    final JpaDialect jpaDialect = getJpaDialect();
    if (jpaDialect != null) {
        jpaTransactionManager.setJpaDialect(jpaDialect);
    }
    final LoggingDelegateTransactionManager loggingDelegateTransactionManager = new LoggingDelegateTransactionManager(
            this, jpaTransactionManager);
    final String transactionManagerBeanName = getPersistenceUnitName()
            + PersistenceProperties.TRANSACTION_MANAGER_NAME_SUFFIX;
    MergedContext.getInstance().registerBean(transactionManagerBeanName, loggingDelegateTransactionManager);
    Assertions.assertThat(MergedContext.getInstance().getBean(transactionManagerBeanName)).isNotNull();
    return loggingDelegateTransactionManager;
}
 
开发者ID:subes,项目名称:invesdwin-context-persistence,代码行数:16,代码来源:PersistenceUnitContext.java

示例3: transactionManager

import org.springframework.orm.jpa.JpaTransactionManager; //导入方法依赖的package包/类
@Bean
@Autowired
public JpaTransactionManager transactionManager(EntityManagerFactory entityManagerFactory) 
{
    JpaDialect jpaDialect = new HibernateJpaDialect();
    
    JpaTransactionManager txManager = new JpaTransactionManager();
    txManager.setEntityManagerFactory(entityManagerFactory);
    txManager.setJpaDialect(jpaDialect);
    
    return txManager; 
}
 
开发者ID:ThiagoUriel,项目名称:spring-agora-web,代码行数:13,代码来源:ApplicationConfig.java

示例4: transactionManager

import org.springframework.orm.jpa.JpaTransactionManager; //导入方法依赖的package包/类
@Bean
@Autowired
public JpaTransactionManager transactionManager(EntityManagerFactory emf,
		JpaDialect dialect) {

	JpaTransactionManager txManager = new JpaTransactionManager();
	txManager.setEntityManagerFactory(emf);
	txManager.setJpaDialect(dialect);
	return txManager;
}
 
开发者ID:JensKapitza,项目名称:jsf-exmple,代码行数:11,代码来源:PersistenceConfig.java

示例5: init

import org.springframework.orm.jpa.JpaTransactionManager; //导入方法依赖的package包/类
/**
 * Initializes the hypersonic db.
 */
public synchronized void init(String... packagesToScan) {
    if (ArrayUtils.isEmpty(packagesToScan)) {
        throw new RuntimeException("Package names to scan must be provided as arg");
    }

    if (isInitialized()) {
        //If already initialized just return cleanly
        return;
    }

    try {
        dataSource = new BasicDataSource();
        dataSource.setDriverClassName("org.hsqldb.jdbcDriver");
        dataSource.setUrl("jdbc:hsqldb:mem:sprite");
        dataSource.setUsername("sa");
        dataSource.setPassword("");

        JpaDialect dialect = new HibernateJpaDialect();
        LocalContainerEntityManagerFactoryBean localEMFactory = new LocalContainerEntityManagerFactoryBean();

        localEMFactory.setJpaDialect(dialect);
        localEMFactory.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
        localEMFactory.setDataSource(dataSource);
        localEMFactory.setPackagesToScan(packagesToScan);

        //localEMFactory.setLoadTimeWeaver(new InstrumentationLoadTimeWeaver());
        Map<String, Object> properties = new HashMap<String, Object>();

        properties.put("eclipselink.logging.level", "FINE");
        properties.put("eclipselink.logging.level.sql", "FINE");
        properties.put("hibernate.hbm2ddl.auto", "create-drop");
        properties.put("hibernate.dialect", "org.hibernate.dialect.HSQLDialect");
        properties.put("PersistenceVersion", "2.1");
        localEMFactory.setJpaPropertyMap(properties);

        localEMFactory.afterPropertiesSet();

        entityManagerFactory = localEMFactory.getObject();
        jdbcTemplate = new JdbcTemplate(dataSource);

        transactionManager = new JpaTransactionManager();
        transactionManager.setJpaDialect(dialect);
        transactionManager.setEntityManagerFactory(entityManagerFactory);
        transactionManager.setDataSource(dataSource);
    } catch (Exception ex) {
        ex.printStackTrace();
        fail("Failed to initialize entityManager: " + ex);
    }

    initialized = true;
}
 
开发者ID:cucina,项目名称:opencucina,代码行数:55,代码来源:HsqlDb.java


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