Package dev.morphia.mapping.experimental
Class CollectionReference<C extends Collection>
- java.lang.Object
-
- dev.morphia.mapping.experimental.MorphiaReference<C>
-
- dev.morphia.mapping.experimental.CollectionReference<C>
-
- Type Parameters:
C
-
- Direct Known Subclasses:
ListReference
,SetReference
public abstract class CollectionReference<C extends Collection> extends MorphiaReference<C>
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CollectionReference()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Object
encode(Mapper mapper, Object value, FieldModel field)
abstract C
get()
Gets the referenced entities.List<Object>
getIds()
Class<C>
getType()
-
Methods inherited from class dev.morphia.mapping.experimental.MorphiaReference
equals, hashCode, ignoreMissing, ignoreMissing, isResolved, resolve, toString, wrap
-
-
-
-
Method Detail
-
get
public abstract C get()
Gets the referenced entities. This may require at least one request to the server.- Specified by:
get
in classMorphiaReference<C extends Collection>
- Returns:
- the referenced entities
-
getType
public Class<C> getType()
- Specified by:
getType
in classMorphiaReference<C extends Collection>
- Returns:
- the referenced type
-
getIds
public List<Object> getIds()
- Specified by:
getIds
in classMorphiaReference<C extends Collection>
- Returns:
- the referenced IDs
-
encode
public Object encode(Mapper mapper, Object value, FieldModel field)
- Specified by:
encode
in classMorphiaReference<C extends Collection>
- Parameters:
mapper
- the mappervalue
- the valuefield
- the MappedField- Returns:
- the encoded vale
-
-