做项目碰到个问题就是 Gclass is not mapped,经过详细检查了,Gclass 以及配置文件发现都没有问题,最后发现原来问题出在总体的配置文件config.xml,由于用的是ibatis+hibernate,部分配置无法自动生成,是要手写的,在config.xm中没有将类的映射代码写上去 :
...................................
<property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JDBCTransactionFactory" />
<property name="class.Users" value="com.mt.domain.Users"/>
<property name="class.Commodity" value="com.mt.domain.Commodity"/>
<property name="class.Gclass" value="com.mt.domain.Gclass"/>
.............................................
因为缺少最后一行的<property name="class.Gclass" value="com.mt.domain.Gclass"/> 所以报这个错误。
参考资料:http://hi.baidu.com/comasp/blog/item/f7e9c42a8405fb9a033bf69c.html
今天做项目的时候 ,hibernate报is not mapped错!
于是找了半天,原来是我的hibernate.cfg.xml少了很多映射.为什么会少呢?因为我的都是拷贝过来的。不是自动生成的。另外hibernate.cfg.xml,要放在根目录下。
把你要映射的都写上去。
<mapping resource="....包名.../Companyinfo.hbm.xml" />
<mapping resource="....包名.../Companyinfo.hbm.xml" />
<mapping resource="....包名.../Companyinfo.hbm.xml" />
<mapping resource="....包名.../Companyinfo.hbm.xml" />
<mapping resource="....包名.../Companyinfo.hbm.xml" />
转自:http://hi.baidu.com/wjsblog/blog/item/9662599558ff9f0c7bf4808a.html
分享到:
相关推荐
前几天在网上下载一个struts2的helloword的例子,那个作者也真够缺德的,搞个错误的程序,害得我查了一天的程序错误。 最后发现竟然是struts.xml被写成啦sturts.xml。 碰见这样的问题先鄙视下提供例子的作者, 再...
黑金zynq入门教程,ALINX黑金Zynq7000开収平台 配套教程第二部
mytabis 报错 Mapped Statements collection does not contain value for
有时struts资源文件添加中文保存时会eclipse出现Some characters cannot be mapped using 'ISO-8859-1' character encoding错误不能保存 解决办法
为了解决: System.ArgumentException: 字体“Calibri”不支持样式“Regular”。 在 System.Drawing.Font.CreateNativeFont() 的问题。 用此字体即可。
MemoryMappedFile 使用 C# 内存中分配一大块地址. 前边分配一个用与共同配置用 后边N个结构体 for循环建 一般用到此问题,两本程序 一个读一个写 循环读写 ----2015/09/24 Lyndon 上海----
基于.NET4.0的MemoryMappedFile实现共享内存通信 共享内存通信可以解决跨线程、跨进程、跨EXE之间通信的问题 对于需要传输图片等引用类数据,可以通过序列化和反序列化配合共享内存实现跨进程(跨EXE)通信 共享...
Hibernate注释大全收藏 声明实体Bean @Entity public class Flight implements Serializable { Long id; @Id public Long getId() { return id; } public void setId(Long id) { this.id = id; } } @Entity ...
HTTP Status 404 - There is no Action mapped for namespace and action name BackMemberGroupAudit..doc
maven+spring-data-jpa环境搭建
利用Memory Mapped File实践A,B跨程序的数据交换
* 9.increnment 插入数据的时候hibernate会给主键添加一个自增的主键,但是一个hibernate实例就维护一个计数器,所以在多个实例运行的时候不能使用这个方法。 * 例:@GeneratedValue(generator = ...
该文档对weblogic使用过程中,包括下载,安装,部署...6. weblogic部署war包action不能访问问题解决方法 [There is no Action mapped for namespace / and action name]. 5 7. java.lang.StackOverflowError. 5 等等
NULL 博文链接:https://605113068.iteye.com/blog/1727088
mappedBy属性用法: 该属性与关联关系的维护权相关。 该属性应放在放弃维护权一方。 该属性值为对方的关联属性,表明以后的关联关系将由它来负责。 使用该属性的注解,无需也不能再设置cascade属性。 ...
Hibernate搜索 描述 Hibernate Search自动从Hibernate ORM实体中提取数据,以将其推送到本地索引或远程索引。...// This entity is mapped to an index @Indexed public class Book { // The entity ID is the documen
MDB: A Memory-Mapped Database and Backend for OpenLDAP
Hibernate Annotation几种关联映射 一对一(One-To-One) 使用@OneToOne注解建立实体Bean之间的一对一关联。一对一关联有三种情况:(1).关联的实体都共享同样的主键,(2).其中一个实体通过外键关联到另一个实体的主键...
Often the collected coordinate system is not the same as the final-mapped system, requiring special formulas for proper conversion. In addition, projecting this data in two and three-dimensional polar...
When mapping from an ER model to a relational model, a strong entity is mapped into a (a) table (b) row (c) column (d) key Correct answer is (a) 10. Which of the following is true about ...