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


Java HibernateJpaVendorAdapter.setDatabasePlatform方法代码示例

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


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

示例1: entityManagerFactoryBean

import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; //导入方法依赖的package包/类
@Bean(name = "entityManagerFactory")
public LocalContainerEntityManagerFactoryBean entityManagerFactoryBean() {
    LocalContainerEntityManagerFactoryBean factoryBean = new LocalContainerEntityManagerFactoryBean();
    factoryBean.setDataSource(dataSource());
    factoryBean.setPackagesToScan("com.chinedu.truststack.persist");

    HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
    vendorAdapter.setShowSql(true);
    vendorAdapter.setDatabasePlatform(hibernateDialect);
    factoryBean.setJpaVendorAdapter(vendorAdapter);

    Properties jpaProperties = new Properties();
    jpaProperties.put("hibernate.show_sql",hibernateShowSql);
    jpaProperties.put("hibernate.hbm2ddl.auto",hibernateUpate);
    factoryBean.setJpaProperties(jpaProperties);
    return factoryBean;
}
 
开发者ID:csokafor,项目名称:spring-security-angularjs,代码行数:18,代码来源:JPAConfig.java

示例2: entityManagerFactory

import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; //导入方法依赖的package包/类
@Bean
public EntityManagerFactory entityManagerFactory() throws SQLException {
	HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
	// vendorAdapter.setGenerateDdl(true); // Crea la tabella e le colonne quando non esistono
	vendorAdapter.setShowSql(config.getShowSql());
	vendorAdapter.setDatabasePlatform("org.hibernate.dialect.MySQL5InnoDBDialect");
	LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
	factory.setJpaVendorAdapter(vendorAdapter);
	List<String> packages = config.getDbEntityPackages();
	packages.add("net.yadaframework.persistence.entity");
	packages.add("net.yadaframework.security.persistence.entity");
	packages.add("net.yadaframework.cms.persistence.entity");
	packages.add("net.yadaframework.commerce.persistence.entity");
	log.info("Scanning packages for entities: {}", StringUtils.join(packages, ","));
	factory.setPackagesToScan(packages.toArray(new String[]{}));
	factory.setDataSource(dataSource());
	factory.afterPropertiesSet();
	return factory.getObject();
}
 
开发者ID:xtianus,项目名称:yadaframework,代码行数:20,代码来源:YadaJpaConfig.java

示例3: entityManagerFactoryBean

import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; //导入方法依赖的package包/类
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactoryBean() {
	Map<String, Object> properties = new Hashtable<>();
	properties.put("javax.persistence.schema-generation.database.action", "none");
	properties.put("hibernate.connection.characterEncoding", "utf8");
	properties.put("hibernate.connection.useUnicode", "true");
	properties.put("hibernate.connection.charSet", "utf8");
	properties.put("hibernate.search.default.directory_provider", "filesystem");
	properties.put("hibernate.search.default.indexBase", context.getInitParameter("indexDir"));

	HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
	adapter.setDatabasePlatform("org.hibernate.dialect.MySQL5InnoDBDialect");

	LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
	factory.setJpaVendorAdapter(adapter);
	factory.setDataSource(this.bookManagerDataSource());
	factory.setPackagesToScan("net.viperfish.bookManager");
	factory.setSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
	factory.setValidationMode(ValidationMode.NONE);
	factory.setJpaPropertyMap(properties);
	return factory;
}
 
开发者ID:shilongdai,项目名称:bookManager,代码行数:23,代码来源:RootApplicationContextConfig.java

示例4: entityManagerFactory

import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; //导入方法依赖的package包/类
/**
 * Creates EntityManagerFactory.
 * @return LocalContainerEntityManagerFactoryBean
 */
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
    
    HibernateJpaVendorAdapter hibernateJpa = new HibernateJpaVendorAdapter();
    hibernateJpa.setDatabasePlatform("org.hibernate.dialect.PostgreSQLDialect");
    hibernateJpa.setShowSql(false);
    hibernateJpa.setGenerateDdl(true);
    
    LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean();
    emf.setDataSource(dataSource);
    emf.setPackagesToScan("pl.orange.labs");
    emf.setJpaVendorAdapter(hibernateJpa);
    emf.setJpaPropertyMap(Collections.singletonMap("javax.persistence.validation.mode", "none"));
    emf.setPersistenceUnitName("Mundo");
    return emf;
}
 
开发者ID:MUNDO-platform,项目名称:srccode,代码行数:21,代码来源:JpaConfig.java

示例5: entityManagerFactory

import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; //导入方法依赖的package包/类
@Bean
@Autowired
public EntityManagerFactory entityManagerFactory(DataSource dataSource)  
{
    HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
    vendorAdapter.setGenerateDdl(generateDDL.booleanValue());
    vendorAdapter.setShowSql(showSQL.booleanValue());
    vendorAdapter.setDatabasePlatform("org.hibernate.dialect.MySQL5InnoDBDialect");
    vendorAdapter.setDatabase(Database.MYSQL);

    Properties properties = new Properties();
    properties.setProperty("hibernate.cache.use_second_level_cache", "true");
    properties.setProperty("hibernate.cache.region.factory_class", "org.hibernate.cache.ehcache.EhCacheRegionFactory");
    properties.setProperty("hibernate.cache.use_query_cache", "true");
    properties.setProperty("hibernate.generate_statistics", showStatistics.toString());
    
    LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
    factory.setJpaVendorAdapter(vendorAdapter);
    factory.setPackagesToScan("io.springagora.core.domain");
    factory.setDataSource(dataSource);
    factory.setJpaProperties(properties);
    factory.afterPropertiesSet();
  
    return factory.getObject();
}
 
开发者ID:ThiagoUriel,项目名称:spring-agora-web,代码行数:26,代码来源:ApplicationConfig.java

示例6: jpaVendorAdapter

import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; //导入方法依赖的package包/类
/**
 * JPA vendor adapter provides specifics about particular JPA implementation to use
 * @return JPA vendor adapter
 */
@Bean
public JpaVendorAdapter jpaVendorAdapter(Environment env){
    HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
    adapter.setDatabase(Database.POSTGRESQL);
    adapter.setShowSql(Boolean.parseBoolean(env.getProperty(PROPERTY_JPA_SHOW_SQL)));
    adapter.setDatabasePlatform(env.getProperty(PROPERTY_JPA_DATABASE_PLATFORM));
    adapter.setGenerateDdl(Boolean.parseBoolean(env.getProperty(PROPERTY_JPA_GENERATE_DDL)));
    return adapter;
}
 
开发者ID:Vapsel,项目名称:social-media-analytic-system,代码行数:14,代码来源:DataSourceConfig.java

示例7: jpaVendorAdapter

import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; //导入方法依赖的package包/类
@Bean
public JpaVendorAdapter jpaVendorAdapter() {
    HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
    adapter.setDatabasePlatform("org.hibernate.dialect.MySQL5InnoDBDialect");
    adapter.setGenerateDdl(true);
    return adapter;
}
 
开发者ID:chaokunyang,项目名称:amanda,代码行数:8,代码来源:RootContextConfiguration.java

示例8: jpaVendorAdapter

import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; //导入方法依赖的package包/类
@Bean
public JpaVendorAdapter jpaVendorAdapter() {
    final HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
    adapter.setDatabase(Database.MYSQL);
    adapter.setShowSql(true);
    adapter.setGenerateDdl(true);
    adapter.setDatabasePlatform("org.hibernate.dialect.MySQL5InnoDBDialect");
    return adapter;
}
 
开发者ID:tvajjala,项目名称:interview-preparation,代码行数:10,代码来源:DBConfig.java

示例9: jpaVendorAdapter

import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; //导入方法依赖的package包/类
@Bean
public JpaVendorAdapter jpaVendorAdapter() {
    HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
    adapter.setShowSql(true);
    adapter.setGenerateDdl(true);
    adapter.setDatabase(Database.H2);
    adapter.setDatabasePlatform("org.hibernate.dialect.H2Dialect");
    return adapter;
}
 
开发者ID:kousen,项目名称:Spring-Framework-Essentials,代码行数:10,代码来源:AppConfig.java

示例10: devVendorAdapter

import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; //导入方法依赖的package包/类
@Bean
@Profile("h2Db")
public JpaVendorAdapter devVendorAdapter(ConfigProperties config) {
    HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
    vendorAdapter.setDatabasePlatform(config.getJdbcDialect());
    vendorAdapter.setGenerateDdl(true);
    vendorAdapter.setShowSql(config.getJdbcShowSql());
    return vendorAdapter;
}
 
开发者ID:mattpwest,项目名称:entelect-spring-webapp-template,代码行数:10,代码来源:JPAConfig.java

示例11: deployedVendorAdapter

import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; //导入方法依赖的package包/类
@Bean
@Profile("sqlDb")
public JpaVendorAdapter deployedVendorAdapter(ConfigProperties config) {
    HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
    vendorAdapter.setDatabasePlatform(config.getJdbcDialect());
    vendorAdapter.setGenerateDdl(false);
    vendorAdapter.setShowSql(config.getJdbcShowSql());
    return vendorAdapter;
}
 
开发者ID:mattpwest,项目名称:entelect-spring-webapp-template,代码行数:10,代码来源:JPAConfig.java

示例12: jpaVendorAdapter

import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; //导入方法依赖的package包/类
@Bean
public JpaVendorAdapter jpaVendorAdapter() {
    HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter();
    hibernateJpaVendorAdapter.setShowSql(showSql);
    hibernateJpaVendorAdapter.setGenerateDdl(hbm2ddlAuto);
    hibernateJpaVendorAdapter.setDatabase(dataBase());
    hibernateJpaVendorAdapter.setDatabasePlatform(dialect);
    return hibernateJpaVendorAdapter;
}
 
开发者ID:przodownikR1,项目名称:springJpaKata,代码行数:10,代码来源:JpaConfig.java

示例13: entityManagerFactoryBean

import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; //导入方法依赖的package包/类
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactoryBean()
		throws ConfigurationException, IOException {
	Map<String, Object> properties = new Hashtable<>();
	String indexPath = this.configuration().getString(GlobalConfig.INDEX_PATH);
	if (indexPath == null) {
		indexPath = GlobalConfig.INDEX_PATH_DEFAULT;
	}
	properties.put("javax.persistence.schema-generation.database.action", "none");
	properties.put("hibernate.connection.characterEncoding", "utf8");
	properties.put("hibernate.connection.useUnicode", "true");
	properties.put("hibernate.connection.charSet", "utf8");
	properties.put("hibernate.search.default.directory_provider", "filesystem");
	properties.put("hibernate.search.default.indexBase", indexPath);

	HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
	adapter.setDatabasePlatform("org.hibernate.dialect.MySQL5InnoDBDialect");

	LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
	factory.setJpaVendorAdapter(adapter);
	factory.setDataSource(this.chatDataSource());
	factory.setPackagesToScan("net.viperfish.chatapplication");
	factory.setSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
	factory.setValidationMode(ValidationMode.NONE);
	factory.setJpaPropertyMap(properties);
	return factory;
}
 
开发者ID:shilongdai,项目名称:LSChatServer,代码行数:28,代码来源:ApplicationRootContext.java

示例14: entityManagerFactory

import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; //导入方法依赖的package包/类
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
  HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter();
  hibernateJpaVendorAdapter.setGenerateDdl(true);
  hibernateJpaVendorAdapter.setDatabasePlatform("org.hibernate.dialect.H2Dialect");

  LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
  entityManagerFactoryBean.setDataSource(dataSource());
  entityManagerFactoryBean.setJpaVendorAdapter(hibernateJpaVendorAdapter);
  entityManagerFactoryBean.setPackagesToScan(environment.getRequiredProperty(ENTITYMANAGER_PACKAGES_TO_SCAN));
  entityManagerFactoryBean.setJpaProperties(hibernateProperties());
  entityManagerFactoryBean.afterPropertiesSet();

  return entityManagerFactoryBean;
}
 
开发者ID:yelzhanzh,项目名称:simplewebapp.com,代码行数:16,代码来源:DataBaseConfig.java

示例15: jpaVendorAdapter

import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; //导入方法依赖的package包/类
@Bean
public JpaVendorAdapter jpaVendorAdapter() {
    HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter();
    hibernateJpaVendorAdapter.setShowSql(false);
    hibernateJpaVendorAdapter.setGenerateDdl(true);
    hibernateJpaVendorAdapter.setDatabase(Database.MYSQL);
    hibernateJpaVendorAdapter.setDatabasePlatform("org.hibernate.dialect.MySQL5Dialect");
    return hibernateJpaVendorAdapter;
}
 
开发者ID:joemarmatulac,项目名称:spring-boot-data-jpa-mysql,代码行数:10,代码来源:DatabaseConfig.java


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