Class MorphiaCodecProvider

  • All Implemented Interfaces:
    org.bson.codecs.configuration.CodecProvider

    public class MorphiaCodecProvider
    extends Object
    implements org.bson.codecs.configuration.CodecProvider
    Provider for codecs for Morphia entities
    Developer note.
    This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
    • Constructor Detail

      • MorphiaCodecProvider

        public MorphiaCodecProvider​(Mapper mapper,
                                    Datastore datastore)
        Creates a provider
        Parameters:
        mapper - the mapper to use
        datastore - the datastore to use
    • Method Detail

      • get

        public <T> org.bson.codecs.Codec<T> get​(Class<T> type,
                                                org.bson.codecs.configuration.CodecRegistry registry)
        Specified by:
        get in interface org.bson.codecs.configuration.CodecProvider
      • getRefreshCodec

        public <T> org.bson.codecs.Codec<T> getRefreshCodec​(T entity,
                                                            org.bson.codecs.configuration.CodecRegistry registry)
        Creates a codec that uses an existing entity for loading rather than creating a new instance.
        Type Parameters:
        T - the entity type
        Parameters:
        entity - the entity to refresh
        registry - the codec registry
        Returns:
        the new codec