introducing a "default" profile so default configuration is simpler

This commit is contained in:
Mic 2013-06-28 12:00:29 +08:00
parent d279d45a5b
commit c13f141251
3 changed files with 22 additions and 11 deletions

View file

@ -25,8 +25,14 @@
<!-- enables scanning for @Transactional annotations -->
<tx:annotation-driven />
<beans profile="jpa,spring-data-jpa">
<!-- ================== 3 Profiles to choose from ===================
- default (uses JPA)
- jdbc (uses Spring" JdbcTemplate)
- spring-data-jpa
=============================================================================-->
<beans profile="default,spring-data-jpa">
<!-- JPA EntityManagerFactory -->
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
p:dataSource-ref="dataSource">
@ -69,8 +75,9 @@
<context:component-scan base-package="org.springframework.samples.petclinic.repository.jdbc"/>
</beans>
<beans profile="jpa">
<beans profile="default">
<!--
Loads JPA beans
Will automatically be transactional due to @Transactional.
EntityManager will be auto-injected due to @PersistenceContext.
PersistenceExceptions will be auto-translated due to @Repository.