hibernate is not mapped hibernate

爱⌒轻易说出口 提交于 2019-12-04 06:59:46

<!-- 定义Hibernate Session工厂 -->
 <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
  <property name="dataSource" ref="dataSource"/>
  <property name="packagesToScan" value="com.bingo.spide"/><!-- 如果多个,用“,”分隔 -->
  <property name="hibernateProperties">
   <props>
    <prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</prop>
    <prop key="net.sf.ehcache.configurationResourceName">${hibernate.ehcache.configFile}</prop>
    <prop key="hibernate.cache.use_second_level_cache">false</prop>
    <prop key="hibernate.cache.use_query_cache">true</prop>
    <prop key="hibernate.search.default.directory_provider">filesystem</prop>
    <prop key="hibernate.search.default.indexBase">${hibernate.search.default.indexBase}</prop>
    <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
   </props>
  </property>
  <property name="namingStrategy">
   <bean class="org.hibernate.cfg.ImprovedNamingStrategy" />
  </property>
 </bean>

 

is not mapped hibernate  报错原因是packagesToScan包路径不对,导致实体类无法初始化。

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!