Spring Data Document

org.springframework.data.mongodb.core.mapping
Class BasicMongoPersistentProperty

java.lang.Object
  extended by org.springframework.data.mapping.model.AbstractPersistentProperty<P>
      extended by org.springframework.data.mapping.model.AnnotationBasedPersistentProperty<MongoPersistentProperty>
          extended by 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

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.springframework.data.mongodb.core.mapping.MongoPersistentProperty
MongoPersistentProperty.PropertyToFieldNameConverter
 
Field Summary
 
Fields inherited from class org.springframework.data.mapping.model.AbstractPersistentProperty
association, field, information, name, owner, propertyDescriptor, rawType
 
Constructor Summary
BasicMongoPersistentProperty(Field field, PropertyDescriptor propertyDescriptor, MongoPersistentEntity<?> owner, org.springframework.data.mapping.model.SimpleTypeHolder simpleTypeHolder)
          Creates a new BasicMongoPersistentProperty.
 
Method Summary
protected  org.springframework.data.mapping.Association<MongoPersistentProperty> createAssociation()
           
 DBRef getDBRef()
          Returns the DBRef if the property is a reference.
 String getFieldName()
          Returns the key to be used to store the value of the property inside a Mongo DBObject.
 int getFieldOrder()
          Returns the order of the field if defined.
 boolean isAssociation()
           
 boolean isDbReference()
          Returns whether the propert is a DBRef.
 boolean isIdProperty()
          Also considers fields as id that are of supported id type and name.
 
Methods inherited from class org.springframework.data.mapping.model.AnnotationBasedPersistentProperty
getSpelExpression, isTransient
 
Methods inherited from class org.springframework.data.mapping.model.AbstractPersistentProperty
getAssociation, getComponentType, getField, getMapValueType, getName, getOwner, getPersistentEntityType, getPropertyDescriptor, getRawType, getType, getTypeInformation, isArray, isCollectionLike, isEntity, isMap, shallBePersisted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.data.mapping.PersistentProperty
getAssociation, getComponentType, getField, getMapValueType, getName, getOwner, getPersistentEntityType, getPropertyDescriptor, getRawType, getSpelExpression, getType, getTypeInformation, isArray, isCollectionLike, isMap, isTransient, shallBePersisted
 

Constructor Detail

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 -
Method Detail

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()

Spring Data Document

Copyright © 2012. All Rights Reserved.