I\'ve created a Spring Boot web application with IntelliJ using Thymeleaf and Hibernate. I\'ve come so far that I can create all the db connections and it\'s working fine. A
Have you tried this?
@Bean
public org.springframework.orm.hibernate5.LocalSessionFactoryBean sessionFactory(){
org.springframework.orm.hibernate5.LocalSessionFactoryBean sessionFactory = new org.springframework.orm.hibernate5.LocalSessionFactoryBean();
sessionFactory.setDataSource(dataSource());
return sessionFactory;
}
@Bean
public DataSource dataSource() {
BasicDataSource dataSource = new BasicDataSource();
dataSource.setDriverClassName("jdbc.driverClassName");
dataSource.setUrl("jdbc.url");
dataSource.setUsername("jdbc.user");
dataSource.setPassword("jdbc.pass");
return dataSource;
}