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


Java HibernateJpaDialect类代码示例

本文整理汇总了Java中org.springframework.orm.jpa.vendor.HibernateJpaDialect的典型用法代码示例。如果您正苦于以下问题:Java HibernateJpaDialect类的具体用法?Java HibernateJpaDialect怎么用?Java HibernateJpaDialect使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


HibernateJpaDialect类属于org.springframework.orm.jpa.vendor包,在下文中一共展示了HibernateJpaDialect类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: entityManagerFactory

import org.springframework.orm.jpa.vendor.HibernateJpaDialect; //导入依赖的package包/类
@Bean(EntityManagerFactoryBeanName)
@Primary
public LocalContainerEntityManagerFactoryBean entityManagerFactory(
        @Qualifier(DataSourceBeanName) DataSource dataSource,
        @Qualifier(JpaVendorAdapterBeanName) JpaVendorAdapter vendorAdapter) {

    LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
    entityManagerFactoryBean.setDataSource(dataSource);
    entityManagerFactoryBean.setJpaVendorAdapter(vendorAdapter);
    entityManagerFactoryBean.setJpaDialect(new HibernateJpaDialect());
    entityManagerFactoryBean.setPackagesToScan(Organization.class.getPackage().getName());
    entityManagerFactoryBean.setPersistenceUnitName("mysqlsource1");
    entityManagerFactoryBean.afterPropertiesSet();

    return entityManagerFactoryBean;
}
 
开发者ID:omacarena,项目名称:only-short-poc,代码行数:17,代码来源:MySqlSource1Config.java

示例2: entityManagerFactory

import org.springframework.orm.jpa.vendor.HibernateJpaDialect; //导入依赖的package包/类
@Bean
public EntityManagerFactory entityManagerFactory() {
    logger.debug("Configuring EntityManager");
    LocalContainerEntityManagerFactoryBean lcemfb = new LocalContainerEntityManagerFactoryBean();
    lcemfb.setPersistenceProvider(new HibernatePersistenceProvider());
    lcemfb.setPersistenceUnitName("persistenceUnit");
    lcemfb.setDataSource(dataSource());
    lcemfb.setJpaDialect(new HibernateJpaDialect());
    lcemfb.setJpaVendorAdapter(jpaVendorAdapter());
    lcemfb.setSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
    Properties jpaProperties = new Properties();
    jpaProperties.put("hibernate.generate_statistics", false);
    jpaProperties.put("hibernate.show_sql", Boolean.parseBoolean(databaseShowSQL));
    lcemfb.setJpaProperties(jpaProperties);
    lcemfb.setPackagesToScan("cn.org.once.cstack.model");
    lcemfb.afterPropertiesSet();
    return lcemfb.getObject();
}
 
开发者ID:oncecloud,项目名称:devops-cstack,代码行数:19,代码来源:DatabaseConfiguration.java

示例3: entityManagerFactory

import org.springframework.orm.jpa.vendor.HibernateJpaDialect; //导入依赖的package包/类
@Bean
public EntityManagerFactory entityManagerFactory() {
    logger.debug("Configuring EntityManager");
    LocalContainerEntityManagerFactoryBean lcemfb = new LocalContainerEntityManagerFactoryBean();
    lcemfb.setPersistenceProvider(new HibernatePersistenceProvider());
    lcemfb.setPersistenceUnitName("persistenceUnit");
    lcemfb.setDataSource(dataSource());
    lcemfb.setJpaDialect(new HibernateJpaDialect());
    lcemfb.setJpaVendorAdapter(jpaVendorAdapter());
    lcemfb.setSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
    Properties jpaProperties = new Properties();
    jpaProperties.put("hibernate.generate_statistics", true);
    jpaProperties.put("hibernate.show_sql", Boolean.parseBoolean(databaseShowSQL));
    lcemfb.setJpaProperties(jpaProperties);
    lcemfb.setPackagesToScan("cn.org.once.cstack.model");
    lcemfb.afterPropertiesSet();
    return lcemfb.getObject();
}
 
开发者ID:oncecloud,项目名称:devops-cstack,代码行数:19,代码来源:DatabaseConfigurationTest.java

示例4: entityManagerFactory

import org.springframework.orm.jpa.vendor.HibernateJpaDialect; //导入依赖的package包/类
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
    final LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean();

    emf.setJpaDialect(new HibernateJpaDialect());
    emf.setJpaVendorAdapter(jpaVendorAdapter());
    emf.setJpaPropertyMap(jpaProperties());
    emf.setPackagesToScan(Constants.APPLICATION_ROOT_PACKAGE);
    emf.setDataSource(dataSource);

    // Setup Papertrail before Liquibase
    papertrailConfig.configureAuditLogAppender();

    // Run Liquibase migrations before ORM setup
    liquibaseConfig.upgradeDatabase();

    return emf;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:19,代码来源:JPAConfig.java

示例5: entityManagerFactory

import org.springframework.orm.jpa.vendor.HibernateJpaDialect; //导入依赖的package包/类
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() throws URISyntaxException {
    LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
    factory.setJpaDialect(new HibernateJpaDialect());

    HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
    vendorAdapter.setGenerateDdl(true);

    factory.setJpaVendorAdapter(vendorAdapter);
    factory.setPersistenceUnitName("production");
    factory.setPackagesToScan("app.domain");
    factory.setDataSource(dataSource());

    factory.afterPropertiesSet();
    return factory;
}
 
开发者ID:Nanofus,项目名称:Photocan,代码行数:17,代码来源:ProdProfile.java

示例6: metaEntityManager

import org.springframework.orm.jpa.vendor.HibernateJpaDialect; //导入依赖的package包/类
@Bean
    public LocalContainerEntityManagerFactoryBean metaEntityManager(EntityManagerFactoryBuilder builder,
                                                                    @Qualifier("metaDataSource") DataSource dataSource) {
        Map<String, Object> props = new HashMap<>();
        props.putAll(jpaProps.getSubProperties("properties."));
//        props.put("hibernate.hbm2ddl.auto", "create");

        LocalContainerEntityManagerFactoryBean factory = builder.dataSource(dataSource)
            .jta(true)
            .persistenceUnit("metaPU")
            .packages("de.weichert.multitenancy")
            .properties(props)
            .build();
        factory.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
        factory.setJpaDialect(new HibernateJpaDialect());
        return factory;
    }
 
开发者ID:jannikweichert,项目名称:multitenancy,代码行数:18,代码来源:MultitenancyConfig.java

示例7: entityManagerFactory

import org.springframework.orm.jpa.vendor.HibernateJpaDialect; //导入依赖的package包/类
@Bean
@Nonnull
public EntityManagerFactory entityManagerFactory() throws SQLException {

    final Properties properties = new Properties();
    properties.setProperty("hibernate.dialect", env.getProperty("db.hibernate.dialect"));
    properties.setProperty("hibernate.hbm2ddl.auto", env.getProperty("db.hibernate.hbm2ddl.auto"));
    properties.setProperty("hibernate.temp.use_jdbc_metadata_defaults", "false");

    final LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
    factory.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
    factory.setJpaDialect(new HibernateJpaDialect());
    factory.setDataSource(pgDataSource());
    factory.setPackagesToScan(this.getClass().getPackage().getName());
    factory.setJpaProperties(properties);
    factory.afterPropertiesSet();

    return factory.getObject();
}
 
开发者ID:andrewortman,项目名称:reddcrawl,代码行数:20,代码来源:PersistenceConfiguration.java

示例8: entityManagerFactory

import org.springframework.orm.jpa.vendor.HibernateJpaDialect; //导入依赖的package包/类
@Bean(name = "entityManagerFactory")
public EntityManagerFactory entityManagerFactory() {
    LocalContainerEntityManagerFactoryBean lcemfb = new LocalContainerEntityManagerFactoryBean();
    lcemfb.setDataSource(dataSource());
    lcemfb.setJpaDialect(new HibernateJpaDialect());
    lcemfb.setJpaVendorAdapter(jpaVendorAdapter());
    lcemfb.setPackagesToScan("org.springframework.data.demo");
    lcemfb.setPersistenceUnitName("persistenceUnit");
    lcemfb.setPersistenceXmlLocation("classpath:META-INF/persistence.xml");
    lcemfb.getJpaPropertyMap().put("hibernate.ejb.naming_strategy", org.hibernate.cfg.ImprovedNamingStrategy.class.getCanonicalName());
    if ("mysql".equals(databaseType)) {
        lcemfb.getJpaPropertyMap().put("hibernate.dialect", org.hibernate.dialect.MySQL5InnoDBDialect.class.getCanonicalName());
    } else if ("h2".equals(databaseType)) {
        lcemfb.getJpaPropertyMap().put("hibernate.dialect", org.hibernate.dialect.H2Dialect.class.getCanonicalName());
    } else if ("derby".equals(databaseType)) {
        lcemfb.getJpaPropertyMap().put("hibernate.dialect", org.hibernate.dialect.DerbyTenSevenDialect.class.getCanonicalName());
    } else {
        throw new RuntimeException("database.type must be configured");
    }
    lcemfb.getJpaPropertyMap().put("hibernate.hbm2ddl.auto", "update");
    lcemfb.getJpaPropertyMap().put("hibernate.hbm2ddl.format", "false");
    lcemfb.getJpaPropertyMap().put("hibernate.hbm2ddl.export", "true");
    lcemfb.getJpaPropertyMap().put("cache.provider_class", "org.hibernate.cache.NoCacheProvider");
    lcemfb.afterPropertiesSet();
    return lcemfb.getObject();
}
 
开发者ID:corneil,项目名称:spring-data-demo,代码行数:27,代码来源:JpaHibernateConfig.java

示例9: entityManagerFactory

import org.springframework.orm.jpa.vendor.HibernateJpaDialect; //导入依赖的package包/类
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() throws PropertyVetoException, ClassNotFoundException {
    LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
    
    /**
     * Renamed to jpa-persistence.xml cause Spring will manage the DataSource and not the
     * container.
     */
    entityManagerFactoryBean.setPersistenceXmlLocation("classpath*:META-INF/jpa-persistence.xml");
    entityManagerFactoryBean.setDataSource(dataSource());
    entityManagerFactoryBean.setJpaDialect(new HibernateJpaDialect());
    entityManagerFactoryBean.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
    entityManagerFactoryBean.setJpaProperties(getJpaProperties());
    
    return entityManagerFactoryBean;
}
 
开发者ID:trein,项目名称:inmapper-ws,代码行数:17,代码来源:ApplicationSpringConfig.java

示例10: jpaProperties

import org.springframework.orm.jpa.vendor.HibernateJpaDialect; //导入依赖的package包/类
public Properties jpaProperties() {
	Properties props = new Properties();

	props.put(Environment.HBM2DDL_AUTO, "create");    // create | spawn | spawn-drop | update | validate | none

	props.put(Environment.FORMAT_SQL, "true");
	props.put(Environment.SHOW_SQL, "true");
	props.put(Environment.RELEASE_CONNECTIONS, ConnectionReleaseMode.ON_CLOSE);
	props.put(Environment.AUTOCOMMIT, "true");
	props.put(Environment.STATEMENT_BATCH_SIZE, 100);
	props.put(Environment.DIALECT, getDialect());

	props.put("jpaDialect", HibernateJpaDialect.class.getName());

	return props;
}
 
开发者ID:debop,项目名称:spring-batch-experiments,代码行数:17,代码来源:JpaConfigBase.java

示例11: entityManagerFactory

import org.springframework.orm.jpa.vendor.HibernateJpaDialect; //导入依赖的package包/类
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() throws PropertyVetoException {
    LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();

    entityManagerFactoryBean.setDataSource(dataSource());

    /**
     * Renamed to jpa-persistence.xml cause Spring will manage the DataSource and not the
     * container.
     */
    entityManagerFactoryBean.setPersistenceXmlLocation("classpath*:META-INF/jpa-persistence.xml");
    entityManagerFactoryBean.setJpaDialect(new HibernateJpaDialect());
    entityManagerFactoryBean.setJpaVendorAdapter(new HibernateJpaVendorAdapter());

    return entityManagerFactoryBean;
}
 
开发者ID:trein,项目名称:gtfs-java,代码行数:17,代码来源:JpaRepositoryConfig.java

示例12: entityManagerFactory

import org.springframework.orm.jpa.vendor.HibernateJpaDialect; //导入依赖的package包/类
@Bean
@DependsOn({"cacheManager",
            "springLiquibase"})
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
    final HibernateJpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter();

    jpaVendorAdapter.setDatabase(jpaVendorDatabase);

    final Map<String, Object> jpaProperties = new LinkedHashMap<>();

    jpaProperties.put("hibernate.cache.region.factory_class", hibernateEhcacheRegionFactoryClass);
    jpaProperties.put("hibernate.cache.use_query_cache", hibernateUseQueryCache);
    jpaProperties.put("hibernate.cache.use_second_level_cache", hibernateUseSecondLevelCache);
    jpaProperties.put("hibernate.hbm2ddl.auto", hibernateHbm2ddl);

    final LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();

    entityManagerFactoryBean.setDataSource(dataSource());
    entityManagerFactoryBean.setJpaDialect(new HibernateJpaDialect());
    entityManagerFactoryBean.setJpaVendorAdapter(jpaVendorAdapter);
    entityManagerFactoryBean.setPackagesToScan("org.unidle.domain");
    entityManagerFactoryBean.setJpaPropertyMap(jpaProperties);
    entityManagerFactoryBean.setMappingResources("jpa/orm.xml");

    return entityManagerFactoryBean;
}
 
开发者ID:martinlau,项目名称:unidle-old,代码行数:27,代码来源:DataConfiguration.java

示例13: entityManagerFactory

import org.springframework.orm.jpa.vendor.HibernateJpaDialect; //导入依赖的package包/类
@Bean(EntityManagerFactoryBeanName)
public LocalContainerEntityManagerFactoryBean entityManagerFactory(
        @Qualifier(DataSourceBeanName) DataSource dataSource,
        @Qualifier(JpaVendorAdapterBeanName) JpaVendorAdapter vendorAdapter) {

    LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
    entityManagerFactoryBean.setDataSource(dataSource);
    entityManagerFactoryBean.setJpaVendorAdapter(vendorAdapter);
    entityManagerFactoryBean.setJpaDialect(new HibernateJpaDialect());
    entityManagerFactoryBean.setPackagesToScan(Organization.class.getPackage().getName());
    entityManagerFactoryBean.setPersistenceUnitName("mysqlsource2");
    entityManagerFactoryBean.afterPropertiesSet();

    return entityManagerFactoryBean;
}
 
开发者ID:omacarena,项目名称:only-short-poc,代码行数:16,代码来源:MySqlSource2Config.java

示例14: entityManagerFactory

import org.springframework.orm.jpa.vendor.HibernateJpaDialect; //导入依赖的package包/类
@Bean
public FactoryBean<EntityManagerFactory> entityManagerFactory() {
	LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
	factory.setDataSource(dataSource());
	factory.setJpaVendorAdapter(jpaVendorAdapter());
	factory.setPackagesToScan("com.namics.oss.spring.support.i18n.dao.jpa");
	factory.setPersistenceUnitName("jpaPersistenceUnit");
	factory.setJpaProperties(jpaProperties());
	factory.setJpaDialect(new HibernateJpaDialect());

	return factory;
}
 
开发者ID:namics,项目名称:spring-i18n-support,代码行数:13,代码来源:JpaMessageSourceDaoTest.java

示例15: transactionManager

import org.springframework.orm.jpa.vendor.HibernateJpaDialect; //导入依赖的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


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