hibernate 错误(转载)

本文详细记录了一次因MySQL VARCHAR类型长度设置不当导致Hibernate原生态SQL错误的问题,并提供了具体的解决办法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

hibernate 异常( 转载
mysql varchar长度过大引起hibernate原生态SQL 错误:No Dialect mapping for JDBC type: -1 错误的解决方法
2009年06月24日 星期三 下午 09:16

先把异常抛出来:

Hibernate: select sum(num) from ( select count(*) as num from cm_facility_wrong as fw left outer join cm_conf as cf on fw.faw_room_id=cf.conf_id left outer join cm_facility as f on fw.fa_id=f.fa_id where 1=1 and fw.faw_room_type=0 union all select count(*) as num from cm_facility_wrong as fw left outer join cm_classroom as cr on fw.faw_room_id=cr.cr_id left outer join cm_facility as f on fw.fa_id=f.fa_id where 1=1 and fw.faw_room_type=1 ) as t


Hibernate:    select fw.faw_id,fw.faw_room_id,fw.faw_room_type, fw.fa_id,fw.faw_type,fw.,fw.faw_time,fw.faw_man, fw.faw_r_company,fw.faw_man,fw.faw_phone,fw.faw_r_time, fw.,fw.faw_state, cr.cr_name,f.fa_no,f.fa_name from cm_facility_wrong as fw left outer join cm_classroom as cr on fw.faw_room_id=cr.cr_id left outer join cm_facility as f on fw.fa_id=f.fa_id where 1=1 and fw.faw_room_type=1 limit ?
WARN - Unhandled Exception thrown: class org.hibernate.MappingException
2009-6-24 20:40:15 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet action threw exception

at org.hibernate.loader.custom.CustomLoader$Metadata.getHibernateType(CustomLoader.java:559)
at or…………………………………………………………………………

原文:http://www.verydemo.com/demo_c146_i11547.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值