hibernate错误

最近刚开始学hibernate,碰到一些问题,将一些错误和解决的方法写写

1.Exception in thread "main" org.hibernate.exception.SQLGrammarException:

   <generator class="native"/>改为 <generator class="uuid"/>

2.Exception in thread "main" org.hibernate.InvalidMappingException:

   可能是property name和实体类的名字有冲突

3.Duplicate property mapping of Id_Card_No found in········

   *.hbm.xml必然有一个属性是重复的写了

4.IllegalArgumentException occurred calling getter of··········

   自己碰到这个问题的原因是对多对一映射不了解,其实这个错误地原因是是待写入数据库的值和数据库字段类型不相匹配

5.Exception in thread "main" org.hibernate.MappingException: Unknown entity:

    某个类没有映射,或者是映射文件没有加载到hibernate.cfg.xml

6.Unknown column '***' in 'where clause'

   我遇到这个问题的原因是在要查询string类型的字段,但是没有在hql语句的查询的值中加入单引号。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值