How to Pass Multiple Packages to packagesToScan property in Spring using XML Configuration

前端 未结 1 1046
眼角桃花
眼角桃花 2021-02-01 05:12

Assume i have two packages com.test1 and com.test2 in different modules called M1 (com.test1) and M2 (com.tes

相关标签:
1条回答
  • 2021-02-01 05:12

    I found answer my self.

    <bean id="entityManager" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">        
         <property name="packagesToScan">
             <array>
                  <value>com.test1</value>
                  <value>com.test2</value>
             </array>
         </property>       
         <property name="dataSource" ref="dataSource" />
         <property name="jpaVendorAdapter" ref="hibernateVendor" />
         <property name="jpaPropertyMap" ref="jpaPropertyMap" />
    </bean>
    
    0 讨论(0)
提交回复
热议问题