Package dev.morphia.mapping.experimental
Class MorphiaReference<T>
- java.lang.Object
-
- dev.morphia.mapping.experimental.MorphiaReference<T>
-
- Type Parameters:
T
-
- Direct Known Subclasses:
CollectionReference
,MapReference
,SingleReference
@Handler(MorphiaReferenceCodec.class) @Deprecated(forRemoval=true, since="2.3") public abstract class MorphiaReference<T> extends Object
Deprecated, for removal: This API element is subject to removal in a future version.Wrapper type for references to entities in other collections- Since:
- 1.5
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(Object o)
Deprecated, for removal: This API element is subject to removal in a future version.abstract T
get()
Deprecated, for removal: This API element is subject to removal in a future version.protected Datastore
getDatastore()
Deprecated, for removal: This API element is subject to removal in a future version.abstract List<Object>
getIds()
Deprecated, for removal: This API element is subject to removal in a future version.protected Mapper
getMapper()
Deprecated, for removal: This API element is subject to removal in a future version.abstract Class<T>
getType()
Deprecated, for removal: This API element is subject to removal in a future version.int
hashCode()
Deprecated, for removal: This API element is subject to removal in a future version.boolean
ignoreMissing()
Deprecated, for removal: This API element is subject to removal in a future version.MorphiaReference<T>
ignoreMissing(boolean ignoreMissing)
Deprecated, for removal: This API element is subject to removal in a future version.Instructs Morphia to ignore missing referenced entities.boolean
isResolved()
Deprecated, for removal: This API element is subject to removal in a future version.protected void
resolve()
Deprecated, for removal: This API element is subject to removal in a future version.String
toString()
Deprecated, for removal: This API element is subject to removal in a future version.static <V> MorphiaReference<V>
wrap(V value)
Deprecated, for removal: This API element is subject to removal in a future version.Wraps an value in a MorphiaReference to storing on an entity
-
-
-
Method Detail
-
wrap
public static <V> MorphiaReference<V> wrap(V value)
Deprecated, for removal: This API element is subject to removal in a future version.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()
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- returns the referenced entity if it exists. May return null.
-
toString
public String toString()
Deprecated, for removal: This API element is subject to removal in a future version.
-
getIds
public abstract List<Object> getIds()
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- the referenced IDs
-
getDatastore
protected Datastore getDatastore()
Deprecated, for removal: This API element is subject to removal in a future version.
-
getType
public abstract Class<T> getType()
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- the referenced type
-
hashCode
public int hashCode()
Deprecated, for removal: This API element is subject to removal in a future version.
-
equals
public boolean equals(Object o)
Deprecated, for removal: This API element is subject to removal in a future version.
-
getMapper
protected Mapper getMapper()
Deprecated, for removal: This API element is subject to removal in a future version.
-
ignoreMissing
public MorphiaReference<T> ignoreMissing(boolean ignoreMissing)
Deprecated, for removal: This API element is subject to removal in a future version.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()
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- true if Morphia will ignore missing referenced entities.
-
isResolved
@MorphiaInternal public final boolean isResolved()
Deprecated, for removal: This API element is subject to removal in a future version.- 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()
Deprecated, for removal: This API element is subject to removal in a future version.
-
-