44 xmlns:context=" http://www.springframework.org/schema/context"
55 xmlns:jpa=" http://www.springframework.org/schema/data/jpa"
66 xsi:schemaLocation=" http://www.springframework.org/schema/beans
7- http://www.springframework.org/schema/beans/spring-beans-3.0 .xsd
7+ http://www.springframework.org/schema/beans/spring-beans.xsd
88 http://www.springframework.org/schema/tx
99 http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
1010 http://www.springframework.org/schema/context
1919
2020 <bean class =" org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
2121
22- <bean id =" dataSource" class =" org.apache.commons.dbcp.BasicDataSource" destroy-method =" close" >
23- <property name =" driverClassName" value =" com.mysql.jdbc.Driver" />
24- <property name =" url" value =" jdbc:mysql://localhost:3306/blog" />
25- <property name =" username" value =" BlogDbUser" />
26- <property name =" password" value =" BlogDbPassword" />
27- <property name =" testOnBorrow" value =" true" />
28- <property name =" validationQuery" value =" SELECT 1" />
29- </bean >
30-
31- <bean id =" entityManagerFactory"
32- class=" org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" >
33- <property name =" dataSource" ref =" dataSource" />
34- <property name =" jpaVendorAdapter" >
35- <bean class =" org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" >
36- <property name =" showSql" value =" true" />
37- </bean >
38- </property >
39- <property name =" jpaPropertyMap" >
40- <map >
41- <entry key =" hibernate.dialect" value =" org.hibernate.dialect.MySQL5Dialect" />
42- <entry key =" hibernate.format_sql" value =" true" />
43- <entry key =" hibernate.hbm2ddl.auto" value =" create" />
44- <entry key =" hibernate.hbm2ddl.import_files_sql_extractor" value =" org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor" />
45- </map >
46- </property >
47- </bean >
48-
4922 <bean id =" transactionManager"
5023 class=" org.springframework.orm.jpa.JpaTransactionManager" >
5124 <property name =" entityManagerFactory" ref =" entityManagerFactory" />
5225 </bean >
5326
5427 <tx : annotation-driven transaction-manager =" transactionManager" />
5528
29+ <beans profile =" dev" >
30+ <import resource =" classpath:/datasource-dev.xml" />
31+ </beans >
32+
33+ <beans profile =" test" >
34+ <import resource =" classpath:/datasource-test.xml" />
35+ </beans >
36+
5637</beans >
0 commit comments