【问题标题】:org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class org.hibernate.ogm.datastore.mongodb.type.GridFSorg.bson.codecs.configuration.CodecConfigurationException:找不到类 org.hibernate.ogm.datastore.mongodb.type.GridFS 的编解码器
【发布时间】:2019-06-19 02:22:30
【问题描述】:

我正在尝试在 Hibernate-ogm 中使用 GridFS。 这简直就是我的课

import org.hibernate.ogm.datastore.mongodb.type.GridFS;

@Embeddable
public class MyEntity implements Serializable{

    private String name;

    public MyEntity () {
    }

    GridFS list;
}

当我尝试使该实体持久化时,我在运行时收到标题错误。 list 字段上的 Eclipse IDE 显示“属性列表在此上下文中具有无效的映射类型”。

【问题讨论】:

    标签: java mongodb gridfs hibernate-ogm


    【解决方案1】:

    目前,GridFS 类型不适用于关联。您只能将其用作实体的属性。

    这有一个问题:https://hibernate.atlassian.net/browse/OGM-1553 您也可以在论坛中找到更多信息:https://discourse.hibernate.org/t/org-hibernate-hibernateexception-ogm000080-could-not-load-an-entity-batch/2148

    【讨论】:

      猜你喜欢
      • 2017-04-07
      • 2018-11-01
      • 2019-08-31
      • 1970-01-01
      • 2017-01-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多