*/
@Bean
public EntityManagerFactory entityManagerFactory() throws IOException {
AbstractJpaConfiguration.log.info("EntityManagerFactory Bean을 생성합니다...");
LocalContainerEntityManagerFactoryBean factoryBean = new LocalContainerEntityManagerFactoryBean();
String[] packagenames = getMappedPackageNames();
if (packagenames != null && packagenames.length > 0) {
log.debug("JPA용 entity를 scan합니다. packages=[{}]", arrayToCommaDelimitedString(packagenames));
factoryBean.setPackagesToScan(packagenames);
}
factoryBean.setJpaProperties(jpaProperties());
factoryBean.setDataSource(dataSource());
HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
adapter.setGenerateDdl(true);
factoryBean.setJpaVendorAdapter(adapter);
setupEntityManagerFactory(factoryBean);
factoryBean.afterPropertiesSet();
AbstractJpaConfiguration.log.info("EntityManagerFactory Bean을 생성했습니다!!!");
return factoryBean.getObject();
}