日期:2014-05-17 浏览次数:20704 次
<!-- Hibernate Session Factory --> - <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> - <property name="dataSource"> <ref bean="dataSource" /> </property> - <property name="hibernateProperties"> - <props> <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.hbm2ddl.auto">update</prop> <prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop> </props> </property> - <!-- Spring機制,掃描<value>中 所有package. --> - <property name="packagesToScan"> - <list> <value>com.cybersoft4u.xian.dmo.common</value> <value>com.cybersoft4u.xian.dmo.privilege</value> <value>com.cybersoft4u.xian.dmo.hr</value> <value>com.cybersoft4u.xian.dmo.device</value> </list> </property> </bean>
------解决方案--------------------
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSource" /> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.hbm2ddl.auto">update</prop> <prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop> </props> </property> <property name="packagesToScan"> <list> <value>com.cybersoft4u.xian.dmo.common</value> <value>com.cybersoft4u.xian.dmo.privilege</value> <value>com.cybersoft4u.xian.dmo.hr</value> <value>com.cybersoft4u.xian.dmo.device</value> </list> </property> </bean>