Spring Data Commons

org.springframework.data.mapping
Interface PersistentProperty<P extends PersistentProperty<P>>

All Known Implementing Classes:
AbstractPersistentProperty, AnnotationBasedPersistentProperty

public interface PersistentProperty<P extends PersistentProperty<P>>

Author:
Graeme Rocher, Jon Brisbin, Oliver Gierke

Method Summary
 Association<P> getAssociation()
           
 Class<?> getComponentType()
          Returns the component type of the type if it is a Collection.
 Field getField()
           
 Class<?> getMapValueType()
          Returns the type of the values if the property is a Map.
 String getName()
          The name of the property
 PersistentEntity<?,P> getOwner()
           
 Iterable<? extends TypeInformation<?>> getPersistentEntityType()
          Returns the TypeInformation if the property references a PersistentEntity.
 PropertyDescriptor getPropertyDescriptor()
          Returns the PropertyDescriptor backing the PersistentProperty.
 Class<?> getRawType()
          Returns the raw type as it's pulled from from the reflected property.
 String getSpelExpression()
           
 Class<?> getType()
          The type of the property
 TypeInformation<?> getTypeInformation()
           
 boolean isArray()
          Returns whether the property is an array.
 boolean isAssociation()
          Returns whether the property is an Association.
 boolean isCollectionLike()
          Returns whether the property is a Collection, Iterable or an array.
 boolean isIdProperty()
          Returns whether the property is the ID property of the owning PersistentEntity.
 boolean isMap()
          Returns whether the property is a Map.
 boolean isTransient()
          Returns whether the property is transient.
 boolean shallBePersisted()
           
 

Method Detail

getOwner

PersistentEntity<?,P> getOwner()

getName

String getName()
The name of the property

Returns:
The property name

getType

Class<?> getType()
The type of the property

Returns:
The property type

getTypeInformation

TypeInformation<?> getTypeInformation()

getPersistentEntityType

Iterable<? extends TypeInformation<?>> getPersistentEntityType()
Returns the TypeInformation if the property references a PersistentEntity. Will return null in case it refers to a simple type. Will return Collection's component type or the Map's value type transparently.

Returns:

getPropertyDescriptor

PropertyDescriptor getPropertyDescriptor()
Returns the PropertyDescriptor backing the PersistentProperty.

Returns:

getField

Field getField()

getSpelExpression

String getSpelExpression()

getAssociation

Association<P> getAssociation()

isIdProperty

boolean isIdProperty()
Returns whether the property is the ID property of the owning PersistentEntity.

Returns:

isCollectionLike

boolean isCollectionLike()
Returns whether the property is a Collection, Iterable or an array.

Returns:

isMap

boolean isMap()
Returns whether the property is a Map.

Returns:

isArray

boolean isArray()
Returns whether the property is an array.

Returns:

isTransient

boolean isTransient()
Returns whether the property is transient.

Returns:

shallBePersisted

boolean shallBePersisted()

isAssociation

boolean isAssociation()
Returns whether the property is an Association.

Returns:

getComponentType

Class<?> getComponentType()
Returns the component type of the type if it is a Collection. Will return the type of the key if the property is a Map.

Returns:
the component type, the map's key type or null if neither Collection nor Map.

getRawType

Class<?> getRawType()
Returns the raw type as it's pulled from from the reflected property.

Returns:
the raw type of the property.

getMapValueType

Class<?> getMapValueType()
Returns the type of the values if the property is a Map.

Returns:
the map's value type or null if no Map

Spring Data Commons

Copyright © 2011. All Rights Reserved.