有问题可联系我QQ:429810818

posts - 4, comments - 6, trackbacks - 0, articles - 8
没有添加
<property name="mappingJarLocations">
<list>
<value>WEB-INF/lib/rpm.jar</value>
</list>
</property>
所以spring扫描不到jar里面的hbm文件
注意导出jar的时候记得勾选上Add directory entries选项
贴出完整的sessionFactory的配置示例
<!-- hibernate配置文件 -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.format_sql">${hibernate.format_sql}</prop>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
<prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop>
<prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
<prop key="hibernate.cache.provider_configuration_file_resource_path">{hibernate.cache.provider_configuration_file_resource_path}</prop>
<!--
<prop key="hibernate.connectionReleaseMode">auto</prop> <prop
key="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</prop>
<prop key="hibernate.proxool.existing_pool">false</prop>
-->
</props>
</property>
<property name="mappingResources">
<list>
   <!--数据字典 -->
  <value>dict.hbm.xml</value>
<!-- 安全框架 -->
<value>security2.0.hbm.xml</value>
<!--
数据字典 <value>dict.hbm.xml</value>-->
<value>jbpm.repository.hbm.xml</value>
<value>jbpm.execution.hbm.xml</value>
<value>jbpm.history.hbm.xml</value>
<value>jbpm.task.hbm.xml</value>
<value>jbpm.identity.hbm.xml</value>
<value>workflow.hbm.xml</value>
<!-- <value>MetaModel.hbm.xml</value> -->
</list>
</property>
<property name="mappingJarLocations">
<list>
<value>WEB-INF/lib/rpm.jar</value>
</list>
</property>
<property name="mappingDirectoryLocations">
<list>
<value>${hibernate.mappingDirectoryLocations}</value>
</list>
</property>
</bean>

只有注册用户登录后才能发表评论。


网站导航: