简体   繁体   中英

org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class org.hibernate.ogm.datastore.mongodb.type.GridFS

I'm trying to experiment with GridFS in Hibernate-ogm. This is simply my class

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

@Embeddable
public class MyEntity implements Serializable{

    private String name;

    public MyEntity () {
    }

    GridFS list;
}

I get the error in title at runtime when I try to make this entity persistent. Eclipse IDE on list field says "Attribute list has invalid mapping type in this context".

Currently, the GridFS type doesn't work with associations. You can only use it as an attribute of an entity.

There is an issue for this: https://hibernate.atlassian.net/browse/OGM-1553 You can also find some more information in the forum: https://discourse.hibernate.org/t/org-hibernate-hibernateexception-ogm000080-could-not-load-an-entity-batch/2148

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM