Package dev.morphia.mapping
Class MappedClass
- java.lang.Object
-
- dev.morphia.mapping.MappedClass
-
@Deprecated public class MappedClass extends java.lang.ObjectDeprecated.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 Constructor Description MappedClass(java.lang.Class<?> clazz, Mapper mapper)Deprecated.Creates a MappedClass instance
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> clazz, java.lang.annotation.Annotation ann)Deprecated.Adds the given Annotation to the internal list for the given Class.static voidaddInterestingAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)Deprecated.Adds an annotation for Morphia to retain when mapping.protected voidbasicValidate()Deprecated.com.mongodb.DBObjectcallLifecycleMethods(java.lang.Class<? extends java.lang.annotation.Annotation> event, java.lang.Object entity, com.mongodb.DBObject dbObj, Mapper mapper)Deprecated.Call the lifecycle methodsbooleancontainsJavaFieldName(java.lang.String name)Deprecated.Check java field name that will be stored in mongodbprotected voiddiscover(Mapper mapper)Deprecated.Discovers interesting (that we care about) things about the class.booleanequals(java.lang.Object o)Deprecated.java.lang.annotation.AnnotationgetAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)Deprecated.Looks for an annotation of the type given<T> java.util.List<T>getAnnotations(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)Deprecated.Looks for an annotation in the annotations found on a class while mappingjava.lang.Class<?>getClazz()Deprecated.java.lang.StringgetCollectionName()Deprecated.EmbeddedgetEmbeddedAnnotation()Deprecated.EntitygetEntityAnnotation()Deprecated.java.util.List<MappedField>getFieldsAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)Deprecated.Returns fields annotated with the clazzjava.lang.annotation.AnnotationgetFirstAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)Deprecated.Returns the first found Annotation, or null.java.lang.reflect.FieldgetIdField()Deprecated.MappedFieldgetMappedField(java.lang.String storedName)Deprecated.Returns the MappedField by the name that it will stored in mongodb asMappedFieldgetMappedFieldByJavaField(java.lang.String name)Deprecated.Returns MappedField for a given java field name on the this MappedClassMappedFieldgetMappedIdField()Deprecated.MappedFieldgetMappedVersionField()Deprecated.java.util.List<MappedField>getPersistenceFields()Deprecated.java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.util.List<java.lang.annotation.Annotation>>getRelevantAnnotations()Deprecated.MappedClassgetSuperClass()Deprecated.This is an internal method subject to change without notice.inthashCode()Deprecated.booleanisAbstract()Deprecated.This is an internal method subject to change without notice.booleanisInterface()Deprecated.static booleanisSupportedType(java.lang.Class<?> clazz)Deprecated.Checks to see if it a Map/Set/List or a property supported by the MongoDB java driverjava.lang.StringtoString()Deprecated.voidupdate()Deprecated.Update mappings based on fields/annotations.voidvalidate(Mapper mapper)Deprecated.Validates this MappedClass
-
-
-
Constructor Detail
-
MappedClass
public MappedClass(java.lang.Class<?> clazz, Mapper mapper)Deprecated.Creates a MappedClass instance- Parameters:
clazz- the class to be mappedmapper- the Mapper to use
-
-
Method Detail
-
getSuperClass
public MappedClass getSuperClass()
Deprecated.This is an internal method subject to change without notice.- Returns:
- the parent class of this type if there is one null otherwise
- Since:
- 1.3
-
isInterface
public boolean isInterface()
Deprecated.- Returns:
- true if the MappedClass is an interface
-
isAbstract
public boolean isAbstract()
Deprecated.This is an internal method subject to change without notice.- Returns:
- true if the MappedClass is abstract
- Since:
- 1.3
-
isSupportedType
public static boolean isSupportedType(java.lang.Class<?> clazz)
Deprecated.Checks to see if it a Map/Set/List or a property supported by the MongoDB java driver- Parameters:
clazz- the type to check- Returns:
- true if the type is supported
-
addInterestingAnnotation
public static void addInterestingAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
Deprecated.Adds an annotation for Morphia to retain when mapping.- Parameters:
annotation- the type to retain
-
addAnnotation
public void addAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> clazz, java.lang.annotation.Annotation ann)Deprecated.Adds the given Annotation to the internal list for the given Class.- Parameters:
clazz- the type to addann- the annotation to add
-
callLifecycleMethods
public com.mongodb.DBObject callLifecycleMethods(java.lang.Class<? extends java.lang.annotation.Annotation> event, java.lang.Object entity, com.mongodb.DBObject dbObj, Mapper mapper)Deprecated.Call the lifecycle methods- Parameters:
event- the lifecycle annotationentity- the entity to processdbObj- the dbObject to usemapper- the Mapper to use- Returns:
- dbObj
-
containsJavaFieldName
public boolean containsJavaFieldName(java.lang.String name)
Deprecated.Check java field name that will be stored in mongodb- Parameters:
name- the name to search for- Returns:
- true if a Java field with that name is found
-
getAnnotation
public java.lang.annotation.Annotation getAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
Deprecated.Looks for an annotation of the type given- Parameters:
clazz- the type to search for- Returns:
- the instance if it was found, if more than one was found, the last one added
-
getAnnotations
public <T> java.util.List<T> getAnnotations(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
Deprecated.Looks for an annotation in the annotations found on a class while mapping- Type Parameters:
T- the type of annotation to find- Parameters:
clazz- the class to search for- Returns:
- the instance if it was found, if more than one was found, the last one added
-
getClazz
public java.lang.Class<?> getClazz()
Deprecated.- Returns:
- the clazz
-
getCollectionName
public java.lang.String getCollectionName()
Deprecated.- Returns:
- the collName
-
getEmbeddedAnnotation
public Embedded getEmbeddedAnnotation()
Deprecated.- Returns:
- the embeddedAn
-
getEntityAnnotation
public Entity getEntityAnnotation()
Deprecated.- Returns:
- the entityAn
-
getFieldsAnnotatedWith
public java.util.List<MappedField> getFieldsAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
Deprecated.Returns fields annotated with the clazz- Parameters:
clazz- The Annotation to find.- Returns:
- the list of fields
-
getFirstAnnotation
public java.lang.annotation.Annotation getFirstAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
Deprecated.Returns the first found Annotation, or null.- Parameters:
clazz- The Annotation to find.- Returns:
- First found Annotation or null of none found.
-
getIdField
public java.lang.reflect.Field getIdField()
Deprecated.- Returns:
- the idField
-
getMappedField
public MappedField getMappedField(java.lang.String storedName)
Deprecated.Returns the MappedField by the name that it will stored in mongodb as- Parameters:
storedName- the name to search for- Returns:
- true if that mapped field name is found
-
getMappedFieldByJavaField
public MappedField getMappedFieldByJavaField(java.lang.String name)
Deprecated.Returns MappedField for a given java field name on the this MappedClass- Parameters:
name- the Java field name to search for- Returns:
- the MappedField for the named Java field
-
getMappedIdField
public MappedField getMappedIdField()
Deprecated.- Returns:
- the ID field for the class
-
getMappedVersionField
public MappedField getMappedVersionField()
Deprecated.- Returns:
- the ID field for the class
-
getPersistenceFields
public java.util.List<MappedField> getPersistenceFields()
Deprecated.- Returns:
- the persistenceFields
-
getRelevantAnnotations
public java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.util.List<java.lang.annotation.Annotation>> getRelevantAnnotations()
Deprecated.- Returns:
- the relevantAnnotations
-
hashCode
public int hashCode()
Deprecated.- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
Deprecated.- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toStringin classjava.lang.Object
-
update
public void update()
Deprecated.Update mappings based on fields/annotations.
-
validate
public void validate(Mapper mapper)
Deprecated.Validates this MappedClass- Parameters:
mapper- the Mapper to use for validation
-
basicValidate
protected void basicValidate()
Deprecated.
-
discover
protected void discover(Mapper mapper)
Deprecated.Discovers interesting (that we care about) things about the class.
-
-