Search in sources :

Example 1 with DataSourceBean

use of de.alpharogroup.springconfig.DataSourceBean in project bundle-app-ui by astrapi69.

the class PersistenceJPAConfig method dataSource.

@Bean
public DataSource dataSource() {
    final JdbcUrlBean bean = JdbcUrlBean.builder().protocol("jdbc:h2:").database("file:~/bundlemanagement").parameter("MODE=PostgreSQL").parameter("DB_CLOSE_ON_EXIT=FALSE").parameter("DB_CLOSE_DELAY=-1").build();
    final DataSourceBean dataSourceBean = DataSourceBean.builder().url(JdbcUrlBean.newH2JdbcUrl(bean)).driverClassName("org.h2.Driver").username("sa").password("").build();
    return SpringJpaFactory.newDataSource(dataSourceBean);
}
Also used : JdbcUrlBean(de.alpharogroup.springconfig.JdbcUrlBean) DataSourceBean(de.alpharogroup.springconfig.DataSourceBean) DataSourceBean(de.alpharogroup.springconfig.DataSourceBean) Bean(org.springframework.context.annotation.Bean) LocalContainerEntityManagerFactoryBean(org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean) JdbcUrlBean(de.alpharogroup.springconfig.JdbcUrlBean)

Aggregations

DataSourceBean (de.alpharogroup.springconfig.DataSourceBean)1 JdbcUrlBean (de.alpharogroup.springconfig.JdbcUrlBean)1 Bean (org.springframework.context.annotation.Bean)1 LocalContainerEntityManagerFactoryBean (org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)1