org.springframework.data.mongodb.core.mapping
Class BasicMongoPersistentProperty
java.lang.Object
org.springframework.data.mapping.model.AbstractPersistentProperty<P>
org.springframework.data.mapping.model.AnnotationBasedPersistentProperty<MongoPersistentProperty>
org.springframework.data.mongodb.core.mapping.BasicMongoPersistentProperty
- All Implemented Interfaces:
- org.springframework.data.mapping.PersistentProperty<MongoPersistentProperty>, MongoPersistentProperty
- Direct Known Subclasses:
- CachingMongoPersistentProperty
public class BasicMongoPersistentProperty
- extends org.springframework.data.mapping.model.AnnotationBasedPersistentProperty<MongoPersistentProperty>
- implements MongoPersistentProperty
Mongo specific PersistentProperty
implementation.
- Author:
- Oliver Gierke
Fields inherited from class org.springframework.data.mapping.model.AbstractPersistentProperty |
association, field, information, name, owner, propertyDescriptor, rawType |
Methods inherited from class org.springframework.data.mapping.model.AnnotationBasedPersistentProperty |
getSpelExpression, isTransient |
Methods inherited from class org.springframework.data.mapping.model.AbstractPersistentProperty |
equals, getAssociation, getComponentType, getField, getMapValueType, getName, getOwner, getPersistentEntityType, getPropertyDescriptor, getRawType, getType, getTypeInformation, hashCode, isArray, isCollectionLike, isEntity, isMap, shallBePersisted |
Methods inherited from interface org.springframework.data.mapping.PersistentProperty |
getAssociation, getComponentType, getField, getMapValueType, getName, getOwner, getPersistentEntityType, getPropertyDescriptor, getRawType, getSpelExpression, getType, getTypeInformation, isArray, isCollectionLike, isEntity, isMap, isTransient, shallBePersisted |
BasicMongoPersistentProperty
public BasicMongoPersistentProperty(Field field,
PropertyDescriptor propertyDescriptor,
MongoPersistentEntity<?> owner,
org.springframework.data.mapping.model.SimpleTypeHolder simpleTypeHolder)
- Creates a new
BasicMongoPersistentProperty
.
- Parameters:
field
- propertyDescriptor
- owner
- simpleTypeHolder
-
isAssociation
public boolean isAssociation()
- Specified by:
isAssociation
in interface org.springframework.data.mapping.PersistentProperty<MongoPersistentProperty>
- Overrides:
isAssociation
in class org.springframework.data.mapping.model.AnnotationBasedPersistentProperty<MongoPersistentProperty>
isIdProperty
public boolean isIdProperty()
- Also considers fields as id that are of supported id type and name.
- Specified by:
isIdProperty
in interface org.springframework.data.mapping.PersistentProperty<MongoPersistentProperty>
- Overrides:
isIdProperty
in class org.springframework.data.mapping.model.AnnotationBasedPersistentProperty<MongoPersistentProperty>
- See Also:
SUPPORTED_ID_PROPERTY_NAMES
,
SUPPORTED_ID_TYPES
getFieldName
public String getFieldName()
- Returns the key to be used to store the value of the property inside a Mongo
DBObject
.
- Specified by:
getFieldName
in interface MongoPersistentProperty
- Returns:
getFieldOrder
public int getFieldOrder()
- Description copied from interface:
MongoPersistentProperty
- Returns the order of the field if defined. Will return -1 if undefined.
- Specified by:
getFieldOrder
in interface MongoPersistentProperty
- Returns:
createAssociation
protected org.springframework.data.mapping.Association<MongoPersistentProperty> createAssociation()
- Specified by:
createAssociation
in class org.springframework.data.mapping.model.AbstractPersistentProperty<MongoPersistentProperty>
isDbReference
public boolean isDbReference()
- Description copied from interface:
MongoPersistentProperty
- Returns whether the propert is a
DBRef
. If this returns true you can expect
MongoPersistentProperty.getDBRef()
to return an non-null value.
- Specified by:
isDbReference
in interface MongoPersistentProperty
- Returns:
getDBRef
public DBRef getDBRef()
- Description copied from interface:
MongoPersistentProperty
- Returns the
DBRef
if the property is a reference.
- Specified by:
getDBRef
in interface MongoPersistentProperty
- Returns:
- See Also:
MongoPersistentProperty.isDbReference()
Copyright © 2012. All Rights Reserved.