org.bson.codecs.configuration.CodecConfigurationException:找不到类org.hibernate.ogm.datastore.mongodb.type.GridFS的编解码器

问题描述 投票:1回答:1

我正在尝试在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个回答
0
投票

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

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

© www.soinside.com 2019 - 2024. All rights reserved.