1.可能是因为映射文件( Order.hbm.xm)配置的class路径出错

  1. <hibernate-mapping>
  2. <class name="com.web.bean.Order" table="order">
  3. <id name="orderId" type="java.lang.Integer" column="order_id">
  4. <generator class="increment"></generator>
  5. </id>
  6. <property name="price" type="double" column="order_price" length="12"></property>
  7. <property name="quantity" type="int" column="order_quantity"></property>
  8. <property name="date" type="date" column="date" length="10"></property>
  9. <many-to-one name="seller" column="seller_id" class="com.web.bean.Seller"
  10. not-null="true">
  11. </many-to-one>
  12. <many-to-one name="phone" column="phone_id" class="com.web.bean.Phone"
  13. not-null="true">
  14. </many-to-one>
  15. <many-to-one name="customer" column="customer_id" class="com.web.bean.Customer"
  16. not-null="true">
  17. </many-to-one>
  18. </class>
  19. </hibernate-mapping>

类的路径必须写全,或者在<hibernate-mapping>中加上属性package="com.web.bean"

2.如果以上检查都是对的,那么就看applicationContext.xml中是否加上了 
<value>com/web/bean/Order.hbm.xml</value>

    1. <property name="mappingResources">
    2. <list>
    3. <value>com/web/bean/Customer.hbm.xml</value>
    4. <value>com/web/bean/Seller.hbm.xml</value>
    5. <value>com/web/bean/Brand.hbm.xml</value>
    6. <value>com/web/bean/Kind.hbm.xml</value>
    7. <value>com/web/bean/Order.hbm.xml</value>
    8. <value>com/web/bean/Phone.hbm.xml</value>
    9. <value>com/web/bean/SellerOwnPhone.hbm.xml</value>
    10. </list>
    11. </property>

最新文章

  1. Windows系统盘占用空间分析
  2. ITEXTSHARP学习整理
  3. 基于visual Studio2013解决C语言竞赛题之1007找数
  4. asp.net mvc 上传下载文件的几种方式
  5. input、button、a标签 等定义的按钮尺寸的兼容性问题
  6. 用Java语言实现简单的词法分析器
  7. 集成学习(ensemble learning)
  8. vue.js个人学习心得
  9. 浅谈iOS学习之路(转)
  10. linux 用户/用户组添加修改删除(ubuntu/centos)
  11. 20155337 2016-2017-2 《Java程序设计》第一周学习总结
  12. ref:Web Service 渗透测试从入门到精通
  13. [知识整理]Linux系统WIFI知识的一些整理
  14. 2016级算法第一次练习赛-C.斐波那契进阶
  15. C#自动给文章关键字加链接实现代码
  16. Spring Mvc中@ResponseBody中文乱码解决,以及修改返回的Content-Type
  17. Kernel list_head demo实现
  18. HDU 4649 Professor Tian (概率DP)
  19. [python]变量和赋值
  20. Modbus协议笔记

热门文章

  1. python3-常用模块之time
  2. Django项目: 项目环境搭建 ---- 二、django项目设置
  3. 解决使用mybatis模糊查询为空的问题
  4. 11.Hibernate一对多关系
  5. [转]【全面解禁!真正的Expression Blend实战开发技巧】第八章 FluidMoveBehavior完全解析之一漂浮移动
  6. 关于bind
  7. pickle序列化一个函数,将fun()取出文件
  8. Nopi 导出设置行高
  9. Python学习笔记(五)函数和代码复用
  10. Python爬虫工程师必学——App数据抓取实战