Hibernate:开发中遇到的异常以及异常分析 - 定期更新

1.hql语句的问题:

from customer where name='中国大厦'
其实这个错误并没有错
因为hibernate操作的是对象而不是数据库
所以
此hql语句应该修改如下
from Customer where name='中国大厦'

2.Error creating bean with name 'getCustomer' defined in file [C:\Green\Develop\apache-tomcat-7.0.26\webapps\CRM_3\WEB-INF\classes\com\sdu\crm\applicationContext\applicationContext-customer-lzm.xml]: Cannot resolve reference to bean 'atService' while setting bean property 'atService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'atService' defined in file [C:\Green\Develop\apache-tomcat-7.0.26\webapps\CRM_3\WEB-INF\classes\com\sdu\crm\applicationContext\applicationContext-customer-zjc.xml]: Cannot resolve reference to bean 'atDao' while setting bean property 'atDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'atDao' defined in file [C:\Green\Develop\apache-tomcat-7.0.26\webapps\CRM_3\WEB-INF\classes\com\sdu\crm\applicationContext\applicationContext-customer-zjc.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [C:\Green\Develop\apache-tomcat-7.0.26\webapps\CRM_3\WEB-INF\classes\com\sdu\crm\applicationContext\applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: Could not determine type for: String, for columns: [org.hibernate.mapping.Column(remark)]

解决该异常:
<property name="remark" column="remark" type="String" length="200"></property>
注意:type:的值应该是string 而不是 String

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值