Example usage for org.springframework.orm.jpa.vendor AbstractJpaVendorAdapter setDatabase

List of usage examples for org.springframework.orm.jpa.vendor AbstractJpaVendorAdapter setDatabase

Introduction

In this page you can find the example usage for org.springframework.orm.jpa.vendor AbstractJpaVendorAdapter setDatabase.

Prototype

public void setDatabase(Database database) 

Source Link

Document

Specify the target database to operate on, as a value of the Database enum: DB2, DERBY, H2, HANA, HSQL, INFORMIX, MYSQL, ORACLE, POSTGRESQL, SQL_SERVER, SYBASE

NOTE: This setting will override your JPA provider's default algorithm.

Usage

From source file:org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration.java

@Bean
@ConditionalOnMissingBean/*w  ww  .ja v  a 2s .  c o  m*/
public JpaVendorAdapter jpaVendorAdapter() {
    AbstractJpaVendorAdapter adapter = createJpaVendorAdapter();
    adapter.setShowSql(this.properties.isShowSql());
    adapter.setDatabase(this.properties.determineDatabase(this.dataSource));
    adapter.setDatabasePlatform(this.properties.getDatabasePlatform());
    adapter.setGenerateDdl(this.properties.isGenerateDdl());
    return adapter;
}