Michael Isvy opened SPR-6474 and commented
Please consider that you need to declare an EntityManagerFactory using JavaConfig.
Currently, the code you need to write looks like this:
@Bean
public EntityManagerFactory entityManagerFactory() {
LocalContainerEntityManagerFactoryBean entityManagerFactory = new
LocalContainerEntityManagerFactoryBean();
//...
entityManagerFactory.afterPropertiesSet();
return entityManagerFactory.getObject();
}
There are 2 things that I can easily forget here: the calls to afterPropertiesSet() and to getObject(). It will be much easier if we provide a convenience class called ConfigurationUtils that we could use in that way:
@Bean
public EntityManagerFactory entityManagerFactory() {
LocalContainerEntityManagerFactoryBean entityManagerFactory = new
LocalContainerEntityManagerFactoryBean();
//...
return ConfigurationUtils.proceedFactoryBean(entityManagerFactory);
}
Issue Links:
Michael Isvy opened SPR-6474 and commented
Please consider that you need to declare an EntityManagerFactory using JavaConfig.
Currently, the code you need to write looks like this:
There are 2 things that I can easily forget here: the calls to afterPropertiesSet() and to getObject(). It will be much easier if we provide a convenience class called ConfigurationUtils that we could use in that way:
Issue Links:
@Beanmethods ("is superseded by")