Class MorphiaReference<T>

    • Method Detail

      • wrap

        public static <V> MorphiaReference<V> wrap​(V value)
        Wraps an value in a MorphiaReference to storing on an entity
        Type Parameters:
        V - the type of the value
        Parameters:
        value - the value wrap
        Returns:
        the MorphiaReference wrapper
      • get

        @Nullable
        public abstract T get()
        Returns:
        returns the referenced entity if it exists. May return null.
      • getIds

        public abstract List<Object> getIds()
        Returns:
        the referenced IDs
      • getType

        public abstract Class<T> getType()
        Returns:
        the referenced type
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • ignoreMissing

        public MorphiaReference<T> ignoreMissing​(boolean ignoreMissing)
        Instructs Morphia to ignore missing referenced entities. The default is to throw an exception on missing entities.
        Parameters:
        ignoreMissing - ignore any missing referenced documents
        Returns:
        this
      • ignoreMissing

        public boolean ignoreMissing()
        Returns:
        true if Morphia will ignore missing referenced entities.
      • isResolved

        public final boolean isResolved()
        Returns:
        true if this reference has already been resolved
        Developer note.
        This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
      • resolve

        protected void resolve()