Class SingleReference<T>

  • Type Parameters:
    T -

    public class SingleReference<T>
    extends MorphiaReference<T>
    Developer note.
    This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
    • Constructor Detail

      • SingleReference

        public SingleReference​(Datastore datastore,
                               EntityModel entityModel,
                               Object id)
        Parameters:
        datastore - the datastore to use
        entityModel - the entity's mapped class
        id - the ID value
        Developer note.
        This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
    • Method Detail

      • decode

        public static MorphiaReference<?> decode​(Datastore datastore,
                                                 Mapper mapper,
                                                 PropertyModel mappedField,
                                                 Class<?> paramType,
                                                 org.bson.Document document)
        Decodes a document in to an entity
        Parameters:
        datastore - the datastore
        mapper - the mapper
        mappedField - the MappedField
        paramType - the type of the underlying entity
        document - the Document to decode
        Returns:
        the entity
      • get

        public T get()
        Specified by:
        get in class MorphiaReference<T>
        Returns:
        returns the referenced entity if it exists. May return null.