How to Pass Multiple Packages to packagesToScan property in Spring using XML Configuration -
assume have 2 packages com.test1 , com.test2 in different modules called m1 (com.test1) , m2 (com.test2).
now in next illustration configured module1 package.
<bean id="entitymanager" class="org.springframework.orm.jpa.localcontainerentitymanagerfactorybean"> <property name="packagestoscan" value="com.test1" /> <property name="datasource" ref="datasource" /> <property name="jpavendoradapter" ref="hibernatevendor" /> <property name="jpapropertymap" ref="jpapropertymap" /> </bean>
but want configure module2 bundle in packagestoscan property. how configure.
i found reply 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>
spring spring-jpa
No comments:
Post a Comment