Skip to content

Instantly share code, notes, and snippets.

@lexblay
Created April 22, 2020 22:47
Show Gist options
  • Save lexblay/1b0d8cd38baf95cb5bdfd89a899b02e8 to your computer and use it in GitHub Desktop.
Save lexblay/1b0d8cd38baf95cb5bdfd89a899b02e8 to your computer and use it in GitHub Desktop.
@Primary
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean emfBean = new LocalContainerEntityManagerFactoryBean();
emfBean.setPackagesToScan("com.*");
emfBean.setPersistenceUnitName("persistenceUnit");
emfBean.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
emfBean.setDataSource(dataSource);
emfBean.setJpaProperties(additionalProperties());
return emfBean;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment