org.springframework.datastore.mapping
Interface PersistentEntity

All Superinterfaces:
Initializable
All Known Implementing Classes:
AbstractPersistentEntity, KeyValuePersistentEntity

public interface PersistentEntity
extends Initializable

Represents a persistent entity

Since:
1.0

Method Summary
 List<Association> getAssociations()
          A list of the associations for this entity.
 String getDecapitalizedName()
           
 String getDiscriminator()
          The discriminator used when persisting subclasses of an inheritance hierarchy
 PersistentProperty getIdentity()
          Returns the identity of the instance
 Class getJavaClass()
           
 ClassMapping getMapping()
          Defines the mapping between this persistent entity and an external form
 MappingContext getMappingContext()
          Obtains the MappingContext where this PersistentEntity is defined
 String getName()
          The entity name including any package prefix
 PersistentEntity getParentEntity()
          Returns the parent entity of this entity
 List<PersistentProperty> getPersistentProperties()
          A list of properties to be persisted
 List<String> getPersistentPropertyNames()
          A list of property names that a persistent
 PersistentProperty getPropertyByName(String name)
          Obtains a PersistentProperty instance by name
 PersistentEntity getRootEntity()
          Obtains the root entity of an inheritance hierarchy
 boolean hasProperty(String name, Class type)
          Checks whether an entity has a bean property of the given name and type
 boolean isInstance(Object obj)
          Tests whether the given instance is an instance of this persistent entity
 boolean isOwningEntity(PersistentEntity owner)
          Returns whether the specified entity asserts ownership over this entity
 boolean isRoot()
          Whether this entity is a root entity
 Object newInstance()
          Constructs a new instance
 
Methods inherited from interface org.springframework.datastore.mapping.lifecycle.Initializable
initialize
 

Method Detail

getName

String getName()
The entity name including any package prefix

Returns:
The entity name

getIdentity

PersistentProperty getIdentity()
Returns the identity of the instance

Returns:
The identity

getPersistentProperties

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

Returns:
A list of PersistentProperty instances

getAssociations

List<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

getPropertyByName

PersistentProperty getPropertyByName(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

getJavaClass

Class getJavaClass()
Returns:
The underlying Java class for this entity

isInstance

boolean isInstance(Object obj)
Tests whether the given instance is an instance of this persistent entity

Parameters:
obj - The object
Returns:
True if it is

getMapping

ClassMapping getMapping()
Defines the mapping between this persistent entity and an external form

Returns:
The ClassMapping instance

newInstance

Object newInstance()
Constructs a new instance

Returns:
The new instnace

getPersistentPropertyNames

List<String> getPersistentPropertyNames()
A list of property names that a persistent

Returns:
A List of strings

getDecapitalizedName

String getDecapitalizedName()
Returns:
Returns the name of the class decapitalized form

isOwningEntity

boolean isOwningEntity(PersistentEntity owner)
Returns whether the specified entity asserts ownership over this entity

Parameters:
owner - The owning entity
Returns:
True if it does own this entity

getParentEntity

PersistentEntity getParentEntity()
Returns the parent entity of this entity

Returns:
The ParentEntity instance

getRootEntity

PersistentEntity getRootEntity()
Obtains the root entity of an inheritance hierarchy

Returns:
The root entity

isRoot

boolean isRoot()
Whether this entity is a root entity

Returns:
True if it is a root entity

getDiscriminator

String getDiscriminator()
The discriminator used when persisting subclasses of an inheritance hierarchy

Returns:
The discriminator

getMappingContext

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

Returns:
The MappingContext instance

hasProperty

boolean hasProperty(String name,
                    Class type)
Checks whether an entity has a bean property of the given name and type

Parameters:
name - The name
type - The type
Returns:
True if it does