No Dialect mapping for JDBC type 0

xiaoxiao2021-02-28  77

请看好,我这个是0,类型是0

解决办法:先点赞,点赞后就学习就更稳当了。。以后出错也少了

哈哈,开个玩笑!

编写自己的类!首先出错的原因是jhiberna中并没有定义null值,所以自己需要为hiberna添加null类型;编写自己的dialect类:

public class Dialect extends MySQLDialect { public Dialect(){ super(); registerColumnType(Types.NULL, "null"); registerHibernateType(Types.NULL,"null"); } }之后再hibernate.cfg.xml中配置自己的方言: <property name="dialect">xxx.xxx.xxx.hibernate.Dialect</property>问题解决,就是这么简单轻松.......

转载请注明原文地址: https://www.6miu.com/read-30416.html

最新回复(0)