Spring Data Commons

org.springframework.data.mapping.model
Interface PersistentEntity<T>

All Superinterfaces:
InitializingBean
All Known Implementing Classes:
BasicPersistentEntity

public interface PersistentEntity<T>
extends InitializingBean

Represents a persistent entity

Author:
Graeme Rocher, Jon Brisbin, Oliver Gierke

Method Summary
 void doWithAssociations(AssociationHandler handler)
           
 void doWithProperties(PropertyHandler handler)
           
 Collection<Association> getAssociations()
          A list of the associations for this entity.
 PersistentProperty getIdProperty()
          Returns the identity of the instance
 MappingContext getMappingContext()
          Obtains the MappingContext where this PersistentEntity is defined
 String getName()
          The entity name including any package prefix
 Collection<PersistentProperty> getPersistentProperties()
          A list of properties to be persisted
 PersistentProperty getPersistentProperty(String name)
          Obtains a PersistentProperty instance by name
 Collection<String> getPersistentPropertyNames()
          A list of property names
 PreferredConstructor<T> getPreferredConstructor()
           
 TypeInformation getPropertyInformation()
           
 Class<T> getType()
           
 
Methods inherited from interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
 

Method Detail

getName

String getName()
The entity name including any package prefix

Returns:
The entity name

getPreferredConstructor

PreferredConstructor<T> getPreferredConstructor()

getIdProperty

PersistentProperty getIdProperty()
Returns the identity of the instance

Returns:
The identity

getPersistentProperties

Collection<PersistentProperty> getPersistentProperties()
A list of properties to be persisted

Returns:
A list of PersistentProperty instances

getAssociations

Collection<Association> getAssociations()
A list of the associations for this entity. This is typically a subset of the list returned by getPersistentProperties()

Returns:
A list of associations

getPersistentProperty

PersistentProperty getPersistentProperty(String name)
Obtains a PersistentProperty instance by name

Parameters:
name - The name of the property
Returns:
The PersistentProperty or null if it doesn't exist

getType

Class<T> getType()
Returns:
The underlying Java class for this entity

getPropertyInformation

TypeInformation getPropertyInformation()

getPersistentPropertyNames

Collection<String> getPersistentPropertyNames()
A list of property names

Returns:
A List of strings

getMappingContext

MappingContext getMappingContext()
Obtains the MappingContext where this PersistentEntity is defined

Returns:
The MappingContext instance

doWithProperties

void doWithProperties(PropertyHandler handler)

doWithAssociations

void doWithAssociations(AssociationHandler handler)

Spring Data Commons

Copyright © 2011. All Rights Reserved.