org.springframework.data.mapping
Class BasicPersistentEntity<T>
java.lang.Object
org.springframework.data.mapping.BasicPersistentEntity<T>
- All Implemented Interfaces:
- InitializingBean, PersistentEntity<T>
public class BasicPersistentEntity<T>
- extends Object
- implements PersistentEntity<T>
- Author:
- Jon Brisbin
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
type
protected final Class<T> type
preferredConstructor
protected PreferredConstructor<T> preferredConstructor
idProperty
protected PersistentProperty idProperty
persistentProperties
protected Map<String,PersistentProperty> persistentProperties
associations
protected Map<String,Association> associations
information
protected final TypeInformation information
mappingContext
protected MappingContext mappingContext
BasicPersistentEntity
public BasicPersistentEntity(MappingContext mappingContext,
TypeInformation information)
getPreferredConstructor
public PreferredConstructor<T> getPreferredConstructor()
- Specified by:
getPreferredConstructor
in interface PersistentEntity<T>
setPreferredConstructor
public void setPreferredConstructor(PreferredConstructor<T> constructor)
getName
public String getName()
- Description copied from interface:
PersistentEntity
- The entity name including any package prefix
- Specified by:
getName
in interface PersistentEntity<T>
- Returns:
- The entity name
getIdProperty
public PersistentProperty getIdProperty()
- Description copied from interface:
PersistentEntity
- Returns the identity of the instance
- Specified by:
getIdProperty
in interface PersistentEntity<T>
- Returns:
- The identity
setIdProperty
public void setIdProperty(PersistentProperty property)
getPersistentProperties
public Collection<PersistentProperty> getPersistentProperties()
- Description copied from interface:
PersistentEntity
- A list of properties to be persisted
- Specified by:
getPersistentProperties
in interface PersistentEntity<T>
- Returns:
- A list of PersistentProperty instances
addPersistentProperty
public void addPersistentProperty(PersistentProperty property)
getAssociations
public Collection<Association> getAssociations()
- Description copied from interface:
PersistentEntity
- A list of the associations for this entity. This is typically a subset of the list returned by
PersistentEntity.getPersistentProperties()
- Specified by:
getAssociations
in interface PersistentEntity<T>
- Returns:
- A list of associations
addAssociation
public void addAssociation(Association association)
getPersistentProperty
public PersistentProperty getPersistentProperty(String name)
- Description copied from interface:
PersistentEntity
- Obtains a PersistentProperty instance by name
- Specified by:
getPersistentProperty
in interface PersistentEntity<T>
- Parameters:
name
- The name of the property
- Returns:
- The PersistentProperty or null if it doesn't exist
getType
public Class<T> getType()
- Specified by:
getType
in interface PersistentEntity<T>
- Returns:
- The underlying Java class for this entity
getPropertyInformation
public TypeInformation getPropertyInformation()
- Specified by:
getPropertyInformation
in interface PersistentEntity<T>
getPersistentPropertyNames
public Collection<String> getPersistentPropertyNames()
- Description copied from interface:
PersistentEntity
- A list of property names
- Specified by:
getPersistentPropertyNames
in interface PersistentEntity<T>
- Returns:
- A List of strings
getMappingContext
public MappingContext getMappingContext()
- Description copied from interface:
PersistentEntity
- Obtains the MappingContext where this PersistentEntity is defined
- Specified by:
getMappingContext
in interface PersistentEntity<T>
- Returns:
- The MappingContext instance
afterPropertiesSet
public void afterPropertiesSet()
throws Exception
- Specified by:
afterPropertiesSet
in interface InitializingBean
- Throws:
Exception
doWithProperties
public void doWithProperties(PropertyHandler handler)
- Specified by:
doWithProperties
in interface PersistentEntity<T>
doWithAssociations
public void doWithAssociations(AssociationHandler handler)
- Specified by:
doWithAssociations
in interface PersistentEntity<T>
Copyright © 2011. All Rights Reserved.