我使用自定义方言( https://code.google.com/p/hibernate-sqlite/ )连接Sqlite。因为Hibernate还没有完全支持Sqlite。
如果我不向SqliteDialect
添加以下行,则query.list()
抛出MappingException
registerColumnType(Types.NULL, "null");
registerHibernateType(Types.NULL, "null");
我将nullable = true
添加到实体@列中。
这看起来不错,但是如果这个列有一个null
值,并且当我调用query.list()
时,它会抛出NullPointerException
。
我怎么能解决这个问题。我遗漏了什么?提前谢谢你!
发布于 2014-08-28 09:00:46
SQLite没有解决这个问题。但是,我目前已经将H2 db集成到我的项目中。现在看起来很好。
https://stackoverflow.com/questions/25520751
复制相似问题