将Spring2.5的Jar包换成3.2以后hibernate出现异常 Invocation of init method failed; nested exception is org.hibernate.MappingException: Cannot cache an unknown entity: java.runtime.name
我的应该是Cache配置出错了。把下面CODE加上就OK了。
<property name="entityCacheStrategies">
<props>
</props>
</property>
<property name="collectionCacheStrategies">
<props>
</props>
</property>
<property name="configurationClass">
<value>org.hibernate.cfg.AnnotationConfiguration</value>
</property>
完整的sessionFactory
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation"
value="classpath:/hibernate.cfg.xml" />
<property name="mappingLocations">
<list>
<value>classpath*:jbpm.repository.hbm.xml</value>
<value>classpath*:jbpm.execution.hbm.xml</value>
<value>classpath*:jbpm.history.hbm.xml</value>
<value>classpath*:jbpm.task.hbm.xml</value>
<value>classpath*:jbpm.identity.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
${hibernate.dialect}
</prop>
<prop key="hibernate.show_sql">
${hibernate.show_sql}
</prop>
<prop key="hibernate.cache.use_query_cache">
${hibernate.cache.use_query_cache}
</prop>
<prop key="hibernate.cache.provider_class">
${hibernate.cache.provider_class}
</prop>
<prop
key="hibernate.cache.provider_configuration_file_resource_path">
${hibernate.cache.provider_configuration_file_resource_path}
</prop>
<prop key="hibernate.cache.use_second_level_cache">
${hibernate.cache.use_second_level_cache}
</prop>
<prop key="hibernate.use_sql_comments">
${hibernate.use_sql_comments}
</prop>
<prop key="hibernate.format_sql">
${hibernate.format_sql}
</prop>
<prop key="hibernate.default_schema">${jdbc.schema}</prop>
</props>
</property>
<property name="entityCacheStrategies">
<props>
</props>
</property>
<property name="collectionCacheStrategies">
<props>
</props>
</property>
<property name="configurationClass">
<value>org.hibernate.cfg.AnnotationConfiguration</value>
</property>
<property name="eventListeners">
<map>
<entry key="merge">
<bean
class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener" />
</entry>
</map>
</property>
</bean>
分享到:
相关推荐
java 9 中引入了模块的概念,默认情况下,Java SE中将不再包含java EE 的Jar包 而在 java 6/7 / 8 时关于这个API 都是捆绑在
java annotation实体关系映射,涉及各种实体间的关系
NULL 博文链接:https://lyndon-lin.iteye.com/blog/856002
NULL 博文链接:https://guoyinjian.iteye.com/blog/1259538
Apress.Pro.Entity.Framework.4.0.Mar.2010.pdf
java.io.NotSerializableException: com.baizhi.entity.User 在mybatis中使用二级缓存时候就必须需要将实体类序列化implements Serializable,我的mapper文件使用了<cache/>标签,使用了mybatis提供的二级缓存,所以...
Microsoft.EntityFrameworkCore.SqlServer.dll NuGet 程序包,用以在.NET Core程序中连接SqlServer数据库的组件,当nuget程序包管理器无法正常安装时可以添加此引用到项目中。
java8 看不到源码Pomelo.EntityFrameworkCore.MyCat Pomelo.EntityFrameworkCore.MyCat 是一个 Entity Framework Core 提供者,并针对(基于 Cobar 的开源 MySQL 集群代理)进行了优化 什么是我的猫? 是一款开源...
MySql.Data.EntityFrameworkCore.dll NuGet 程序包,用以在.NET Core程序中连接MySql数据库的组件,当nuget程序包管理器无法正常安装时可以添加此引用到项目中。
Mybatis报错: org.apache.ibatis.exceptions.PersistenceException解决办法 ... Cause: org.apache.ibatis.reflection.ReflectionException: Error instantiating class com.fendo.entity.Person with invalid ty
替换C:\Users\xxxxx\.nuget\packages\z.entityframework.extensions.efcore\2.1.49\lib\netstandard2.0下的Z.EntityFramework.Extensions.EFCore.dll。适用于.net core的ef,解除了1个月使用的限制。
org.apache.http.entity.mime apache的android jar包
克鲁德(Crud):克鲁德.NetCore2.2 com ORM(Pomelo.EntityFrameworkCore.MySql)e角
import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.conn.scheme.Scheme; ...
Explore advanced .NET APIs and create a basic .NET core library with dynamic code generation and metadata inspection to be used by other libraries or client applications. This book starts with the ...
H2 1.4 "Lob not found" 问题 - 在 1.4.183 中修复!...org.hibernate.exception.GenericJDBCException: could not load an entity: [de.bwaldvogel.LobEntity#1] at org.hibernate.exception.SQLStateConverter.handl
Ricardo Peres is a Portuguese developer, blogger, and occasionally an e-book author. He has more than 17 years of experience in software development, using technologies such as C/C++, Java, JavaScript...
Hibernate逆向生成entity和hbm.xml文件这是一个视频,比文件看起来更加给力。
javax.persistence.Entity.class javax.persistence.EntityExistsException.class javax.persistence.EntityListeners.class javax.persistence.EntityManager.class javax.persistence.EntityManagerFactory.class ...
Z.EntityFramework.Extensions 破解 注册机,详细破解方法