Spring Data Core

org.springframework.data.mapping.context
Interface MappingContext<E extends PersistentEntity<?,P>,P extends PersistentProperty<P>>

All Known Implementing Classes:
AbstractMappingContext

public interface MappingContext<E extends PersistentEntity<?,P>,P extends PersistentProperty<P>>

This interface defines the overall context including all known PersistentEntity instances and methods to obtain instances on demand. it is used internally to establish associations between entities and also at runtime to obtain entities by name.

Author:
Oliver Gierke, Jon Brisbin, Graeme Rocher

Method Summary
 Collection<E> getPersistentEntities()
          Returns all PersistentEntitys held in the context.
 E getPersistentEntity(Class<?> type)
          Returns a PersistentEntity for the given Class.
 E getPersistentEntity(P persistentProperty)
          Returns the PersistentEntity mapped by the given PersistentProperty.
 E getPersistentEntity(TypeInformation<?> type)
          Returns a PersistentEntity for the given TypeInformation.
 PersistentPropertyPath<P> getPersistentPropertyPath(PropertyPath propertyPath)
          Returns all PersistentPropertys for the given path expression based on the given PropertyPath.
 

Method Detail

getPersistentEntities

Collection<E> getPersistentEntities()
Returns all PersistentEntitys held in the context.

Returns:

getPersistentEntity

E getPersistentEntity(Class<?> type)
Returns a PersistentEntity for the given Class. Will return null for types that are considered simple ones.

Parameters:
type - must not be null.
Returns:
See Also:
SimpleTypeHolder.isSimpleType(Class)

getPersistentEntity

E getPersistentEntity(TypeInformation<?> type)
Returns a PersistentEntity for the given TypeInformation. Will return null for types that are considered simple ones.

Parameters:
type - must not be null.
Returns:
See Also:
SimpleTypeHolder.isSimpleType(Class)

getPersistentEntity

E getPersistentEntity(P persistentProperty)
Returns the PersistentEntity mapped by the given PersistentProperty.

Parameters:
persistentProperty -
Returns:
the PersistentEntity mapped by the given PersistentProperty or null if no PersistentEntity exists for it or the PersistentProperty does not refer to an entity (the type of the property is considered simple see SimpleTypeHolder.isSimpleType(Class)).

getPersistentPropertyPath

PersistentPropertyPath<P> getPersistentPropertyPath(PropertyPath propertyPath)
Returns all PersistentPropertys for the given path expression based on the given PropertyPath.

Type Parameters:
T -
Parameters:
type -
path -
Returns:

Spring Data Core

Copyright © 2011-2013-2013 Pivotal. All Rights Reserved.