Last active
April 21, 2018 10:35
-
-
Save mrpehlivan/86ed6bcdb3f6025f9b1d570e83bc5da4 to your computer and use it in GitHub Desktop.
DatabaseConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.arif.crud.configuration; | |
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder; | |
import org.springframework.boot.context.properties.ConfigurationProperties; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.annotation.Primary; | |
import org.springframework.data.jpa.repository.config.EnableJpaRepositories; | |
import org.springframework.transaction.annotation.EnableTransactionManagement; | |
import javax.sql.DataSource; | |
@Configuration | |
@EnableJpaRepositories("com.arif") | |
@EnableTransactionManagement | |
public class DatabaseConfiguration { | |
@Primary | |
@ConfigurationProperties(prefix = "spring.datasource") | |
public DataSource dataSource() { | |
return DataSourceBuilder.create().build(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment