Sqlite& Hibernate Ex:否JDBC类型的Dialect映射:0 [英] Sqlite & Hibernate Ex: No Dialect mapping for JDBC type: 0

查看:154
本文介绍了Sqlite& Hibernate Ex:否JDBC类型的Dialect映射:0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用自定义方言( https://code.google.com/p/hibernate -sqlite / )用于连接Sqlite和Hibernate。因为Hibernate并没有完全支持Sqlite。

Im using a custom dialect( https://code.google.com/p/hibernate-sqlite/ ) for connect Sqlite with Hibernate. Because Hibernate doesnt full support Sqlite yet.

如果我不添加以下行到 SqliteDialect query.list()抛出 MappingException

If i don't add following lines to SqliteDialect, query.list() throwing MappingException

registerColumnType(Types.NULL, "null");
registerHibernateType(Types.NULL, "null");

我将 nullable = true 添加到我的实体@Column。

I added nullable = true to my Entity @Column.

目前看起来不错,但是如果这个列有一个 null 值,当我调用 query.list(),它会抛出 NullPointerException

That currently looking good but if this column have a null value and When i called query.list(), it throws NullPointerException.

我解决这个问题。我错过了什么?谢谢!

How could I resolve this. What am I missing? Thank you in advance!

推荐答案

SQLite没有解决问题。但是,我目前已将H2 db集成到我的项目中。现在看起来很好。

SQLite did not solve the problem. But, I've currently integrated H2 db to my project. Thats looking fine now.

这篇关于Sqlite& Hibernate Ex:否JDBC类型的Dialect映射:0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆