Class SingleReference<T>

  • Type Parameters:
    T -

    @Deprecated(forRemoval=true,
                since="2.3")
    public class SingleReference<T>
    extends MorphiaReference<T>
    Deprecated, for removal: This API element is subject to removal in a future version.
    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,
                               Mapper mapper,
                               EntityModel entityModel,
                               Object id)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Parameters:
        datastore - the datastore to use
        mapper - the mapper 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)
        Deprecated, for removal: This API element is subject to removal in a future version.
        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()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        get in class MorphiaReference<T>
        Returns:
        returns the referenced entity if it exists. May return null.
      • getIds

        public List<Object> getIds()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        getIds in class MorphiaReference<T>
        Returns:
        the referenced IDs
      • getType

        public Class<T> getType()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        getType in class MorphiaReference<T>
        Returns:
        the referenced type