Project

General

Profile

« Previous | Next » 

Revision 2638be38

Added by Andreas Müller over 8 years ago

migrate to hibernate 5 for cdmlib-services and cdmlib-ext #4716

  • (except for hibernate search tests)
  • including new spring-config structure

View differences:

cdmlib-services/src/test/resources/eu/etaxonomy/cdm/applicationContext-test.xml
9 9
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
10 10
    ">
11 11

  
12
    <context:property-override location="classpath:override.properties"/>
12
   <context:property-override location="classpath:override.properties"/>
13 13

  
14
   <context:component-scan base-package="eu/etaxonomy/cdm/api/service">
15
    </context:component-scan>
14
   <context:component-scan base-package="eu/etaxonomy/cdm/api/service"/>
15
   
16 16
 <!--    <context:component-scan base-package="eu/etaxonomy/cdm/api/validation">
17 17
    </context:component-scan>
18 18
    --> 
19 19

  
20

  
21
    <import resource="classpath:/eu/etaxonomy/cdm/services.xml"/>
22

  
23
	<context:component-scan base-package="eu/etaxonomy/cdm/api/cache"/>
24
    <!-- enable the configuration of transactional behavior based on annotations -->
25
    <tx:annotation-driven transaction-manager="transactionManager"/>
26

  
27 20
    <bean id="dataSource" class="org.unitils.database.UnitilsDataSourceFactoryBean"/>
21
    
22
    <import resource="classpath:/eu/etaxonomy/cdm/applicationContext-test.common.xml" />
23
    
24
    <import resource="classpath:/eu/etaxonomy/cdm/persistence.xml" />
25
    <import resource="classpath:/eu/etaxonomy/cdm/services_base_test.xml"/>
28 26

  
29
    <!--
30
        use TestingTermInitializer
31
     -->
32
    <bean id="testingTermInitializer" class="eu.etaxonomy.cdm.database.TestingTermInitializer">
33
        <property name="termsDataSet" value="classpath:/eu/etaxonomy/cdm/database/TermsDataSet-with_auditing_info.xml"/>
34
        <property name="termsDtd" value="classpath:/eu/etaxonomy/cdm/persistence/dao/hibernate/dataset.dtd"/>
35
        <property name="omit" value="false"/>
36
    </bean>
37
    <bean id="persistentTermInitializer" class="eu.etaxonomy.cdm.database.PersistentTermInitializer">
38
        <property name="omit" value="true"/>
39
    </bean>
40

  
41
    <bean id="hibernateProperties"
42
        class="org.springframework.beans.factory.config.PropertiesFactoryBean">
43
        <property name="properties">
44
            <props>
45
                <prop key="hibernate.cache.region.factory_class">org.hibernate.cache.internal.NoCachingRegionFactory</prop>
46
                <prop key="hibernate.show_sql">false</prop>
47
                <prop key="hibernate.format_sql">false</prop>
48
                <prop key="hibernate.search.default.directory_provider">org.hibernate.search.store.impl.FSDirectoryProvider</prop>
49
                <!-- TODO trying to use a managed session context
50
                <prop key="hibernate.current_session_context_class">managed</prop>
51
                -->
52

  
53
                <prop key="hibernate.search.default.indexBase">./target/index</prop>
54
                <!--  hibernate.search.default.exclusive_index_use=false
55
                      locks must not only be released after application shutdown in test environment -->
56
                <prop key="hibernate.search.default.exclusive_index_use">false</prop>
57
                <!-- hsqldb v. <1.9 has a bug (http://sourceforge.net/tracker/?func=detail&atid=378131&aid=1407528&group_id=23316)
58
                    due to which it is not possible to use batch updates, so we need to disable
59
                    hibernate batching when using hsqldb in the app context: -->
60
                <prop key="hibernate.jdbc.batch_size">0</prop>
61
            </props>
62
        </property>
63
    </bean>
27
    <context:component-scan base-package="eu/etaxonomy/cdm/api/cache"/>
64 28

  
65 29
    <bean id="tableGeneratorGlobalOverride"
66 30
        class="eu.etaxonomy.cdm.persistence.hibernate.TableGeneratorGlobalOverride">
......
76 40
    </bean>
77 41

  
78 42

  
79
<!--
80
   We do not use spelling suggestions anymore. This one relates to spring modules which is
81
    somewhat out-dated. Once we work again with spelling suggestions we better use a modern
82
    approach, e.g. annotation based.
83
    <bean id="taxonSpellingDirectory" class="org.springmodules.lucene.index.support.FSDirectoryFactoryBean">
84
      <property name="location" value="file:./target/index/eu.etaxonomy.cdm.model.taxon.TaxonBase_spelling"/>
85
      <property name="create" value="true"/>
86
    </bean> -->
87

  
88 43
    <bean id="validatorFactory" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
89 44
        <property name="mappingLocations">
90 45
            <set>
......
94 49
    </bean>
95 50

  
96 51

  
97
    <!-- equips a new and empty database with the initial set of meta data and admin user   -->
98
    <bean id="firstDataInserter" class="eu.etaxonomy.cdm.api.application.FirstDataInserter" />
99

  
100 52
    <!-- security  -->
101 53
    <bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.Md5PasswordEncoder"/>
102 54
    <bean id="saltSource" class="org.springframework.security.authentication.dao.ReflectionSaltSource">
......
116 68
        </constructor-arg>
117 69
    </bean>
118 70

  
119
</beans>
71
</beans>

Also available in: Unified diff