Skip to content

Commit b35ae46

Browse files
committed
Get rid of persistence.xml usage.
With Spring 3.1 we may replace usage of this file by invocation of one setter. @see http://www.baeldung.com/2011/12/13/the-persistence-layer-with-spring-3-1-and-jpa/ No functional changes.
1 parent 03ebf16 commit b35ae46

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/main/java/ru/mystamps/web/config/DbConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ public LocalContainerEntityManagerFactoryBean getEntityManagerFactory() {
7575
entityManagerFactory.setJpaVendorAdapter(getJpaVendorAdapter());
7676
entityManagerFactory.setDataSource(dataSource);
7777

78+
entityManagerFactory.setPackagesToScan(new String[] { "ru.mystamps.web.entity" });
79+
7880
final Map<String, String> jpaProperties = new HashMap<String, String>();
7981
jpaProperties.put("hibernate.format_sql", formatSql);
8082
jpaProperties.put("hibernate.connection.charset", "UTF-8");

src/main/resources/META-INF/persistence.xml

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)