Class MorphiaCodecProvider

  • All Implemented Interfaces:
    CodecProvider

    @MorphiaInternal
    public class MorphiaCodecProvider
    extends Object
    implements 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​(Datastore datastore)
        Creates a provider
        Parameters:
        datastore - the Datastore to use
    • Method Detail

      • getDatastore

        protected Datastore getDatastore()
      • getRefreshCodec

        @Nullable
        public <T> Codec<T> getRefreshCodec​(T entity,
                                            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
      • getMapper

        protected Mapper getMapper()