【问题标题】:Sqlite & Hibernate Ex: No Dialect mapping for JDBC type: 0Sqlite & Hibernate Ex:没有 JDBC 类型的方言映射:0
【发布时间】:2014-08-27 06:59:29
【问题描述】:

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

如果我不在SqliteDialect 中添加以下行,query.list() throwing MappingException

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

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

目前看起来不错,但如果此列具有 null 值,并且当我调用 query.list() 时,它会抛出 NullPointerException

我该如何解决这个问题。我错过了什么?提前谢谢!

【问题讨论】:

    标签: java hibernate sqlite jpa


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-02-19
      • 1970-01-01
      • 2012-08-22
      • 1970-01-01
      • 1970-01-01
      • 2014-08-08
      • 2015-03-27
      相关资源
      最近更新 更多