Revision 025804f2
Added by Andreas Müller over 8 years ago
cdmlib-test/src/test/resources/eu/etaxonomy/cdm/applicationContext-test.xml | ||
---|---|---|
20 | 20 |
|
21 | 21 |
<bean id="dataSource" class="org.unitils.database.UnitilsDataSourceFactoryBean"/> |
22 | 22 |
|
23 |
<import resource="classpath:/eu/etaxonomy/cdm/persistence.xml" /> |
|
23 |
<import resource="classpath:/eu/etaxonomy/cdm/persistence_test.xml" />
|
|
24 | 24 |
|
25 | 25 |
<import resource="classpath:/eu/etaxonomy/cdm/applicationContext-test.common.xml" /> |
26 | 26 |
</beans> |
cdmlib-test/src/test/resources/eu/etaxonomy/cdm/persistence.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<beans xmlns="http://www.springframework.org/schema/beans" |
|
3 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" |
|
4 |
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" |
|
5 |
xsi:schemaLocation=" |
|
6 |
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd |
|
7 |
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd |
|
8 |
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd |
|
9 |
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd |
|
10 |
"> |
|
11 |
|
|
12 |
<bean id="transactionManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager"> |
|
13 |
<property name="sessionFactory" ref="sessionFactory" /> |
|
14 |
</bean> |
|
15 |
|
|
16 |
<bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean" depends-on="tableGeneratorGlobalOverride"> |
|
17 |
<property name="implicitNamingStrategy"> |
|
18 |
<bean class="org.hibernate.boot.model.naming.ImplicitNamingStrategyComponentPathImpl" /> |
|
19 |
</property> |
|
20 |
|
|
21 |
|
|
22 |
<!-- <property name="entityInterceptor"> |
|
23 |
<bean class="eu.etaxonomy.cdm.persistence.hibernate.CdmHibernateInterceptor" /> |
|
24 |
</property> |
|
25 |
--> |
|
26 |
<property name="configLocation" value="classpath:eu/etaxonomy/cdm/hibernate.cfg.xml"/> |
|
27 |
|
|
28 |
<!-- |
|
29 |
If dataSource is set, this will override corresponding settings in Hibernate properties. |
|
30 |
If this is set, the Hibernate settings should not define a connection provider to |
|
31 |
avoid meaningless double configuration. |
|
32 |
|
|
33 |
see also org.springframework.orm.hibernate3.AbstractSessionFactoryBean.setDataSource(DataSource dataSource) |
|
34 |
--> |
|
35 |
<property name="dataSource" ref="dataSource"/> |
|
36 |
|
|
37 |
<property name="hibernateProperties" ref="hibernateProperties"/> |
|
38 |
</bean> |
|
39 |
|
|
40 |
</beans> |
cdmlib-test/src/test/resources/eu/etaxonomy/cdm/persistence_test.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<beans xmlns="http://www.springframework.org/schema/beans" |
|
3 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" |
|
4 |
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" |
|
5 |
xsi:schemaLocation=" |
|
6 |
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd |
|
7 |
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd |
|
8 |
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd |
|
9 |
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd |
|
10 |
"> |
|
11 |
|
|
12 |
<bean id="transactionManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager"> |
|
13 |
<property name="sessionFactory" ref="sessionFactory" /> |
|
14 |
</bean> |
|
15 |
|
|
16 |
<bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean" depends-on="tableGeneratorGlobalOverride"> |
|
17 |
<property name="implicitNamingStrategy"> |
|
18 |
<bean class="org.hibernate.boot.model.naming.ImplicitNamingStrategyComponentPathImpl" /> |
|
19 |
</property> |
|
20 |
|
|
21 |
|
|
22 |
<!-- <property name="entityInterceptor"> |
|
23 |
<bean class="eu.etaxonomy.cdm.persistence.hibernate.CdmHibernateInterceptor" /> |
|
24 |
</property> |
|
25 |
--> |
|
26 |
<property name="configLocation" value="classpath:eu/etaxonomy/cdm/hibernate.cfg.xml"/> |
|
27 |
|
|
28 |
<!-- |
|
29 |
If dataSource is set, this will override corresponding settings in Hibernate properties. |
|
30 |
If this is set, the Hibernate settings should not define a connection provider to |
|
31 |
avoid meaningless double configuration. |
|
32 |
|
|
33 |
see also org.springframework.orm.hibernate3.AbstractSessionFactoryBean.setDataSource(DataSource dataSource) |
|
34 |
--> |
|
35 |
<property name="dataSource" ref="dataSource"/> |
|
36 |
|
|
37 |
<property name="hibernateProperties" ref="hibernateProperties"/> |
|
38 |
</bean> |
|
39 |
|
|
40 |
</beans> |
Also available in: Unified diff
Rename persistence.xml to persistence_test.xml in cdmlib-test