/*
 * Created on 25. 7. 2017 17:35:12
 *
 */
package com.jh.radegast;

import javax.sql.DataSource;

import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;



/**
 * The Class RepositoryConfig.
 */
@Configuration
@ConfigurationProperties(prefix = "spring.datasource")
@EntityScan(basePackages = {"com.jh"})
public class RepositoryConfig extends HikariConfig {

    @Bean
    @Primary
    public DataSource dataSource() {
        return new HikariDataSource(this);
    }
    
}
