|
Spring Data Commons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.data.mapping.BasicPersistentEntity<T,P>
public class BasicPersistentEntity<T,P extends PersistentProperty<P>>
Simple value object to capture information of PersistentEntity
s.
Field Summary | |
---|---|
protected Map<String,Association<P>> |
associations
|
protected P |
idProperty
|
protected TypeInformation<T> |
information
|
protected Map<String,P> |
persistentProperties
|
protected PreferredConstructor<T> |
preferredConstructor
|
Constructor Summary | |
---|---|
BasicPersistentEntity(TypeInformation<T> information)
Creates a new BasicPersistentEntity from the given TypeInformation . |
Method Summary | |
---|---|
void |
addAssociation(Association<P> association)
Adds an Association to the entity. |
void |
addPersistentProperty(P property)
Adds a PersistentProperty to the entity. |
void |
doWithAssociations(AssociationHandler<P> handler)
|
void |
doWithProperties(PropertyHandler<P> handler)
|
Collection<Association<P>> |
getAssociations()
A list of the associations for this entity. |
P |
getIdProperty()
Returns the id property of the PersistentEntity . |
String |
getName()
The entity name including any package prefix |
Collection<P> |
getPersistentProperties()
A list of properties to be persisted |
P |
getPersistentProperty(String name)
Obtains a PersistentProperty instance by name |
Collection<String> |
getPersistentPropertyNames()
A list of property names |
PreferredConstructor<T> |
getPreferredConstructor()
|
Class<T> |
getType()
|
TypeInformation<T> |
getTypeInformation()
|
void |
setIdProperty(P property)
Sets the id property for the entity. |
void |
verify()
Callback method to trigger validation of the PersistentEntity . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final PreferredConstructor<T> preferredConstructor
protected final TypeInformation<T> information
protected final Map<String,P extends PersistentProperty<P>> persistentProperties
protected final Map<String,Association<P extends PersistentProperty<P>>> associations
protected P extends PersistentProperty<P> idProperty
Constructor Detail |
---|
public BasicPersistentEntity(TypeInformation<T> information)
BasicPersistentEntity
from the given TypeInformation
.
information
- Method Detail |
---|
public PreferredConstructor<T> getPreferredConstructor()
getPreferredConstructor
in interface PersistentEntity<T,P extends PersistentProperty<P>>
public String getName()
PersistentEntity
getName
in interface PersistentEntity<T,P extends PersistentProperty<P>>
public P getIdProperty()
PersistentEntity
PersistentEntity
. Must never
return null as a PersistentEntity
instance must not be
created if there is no id property.
getIdProperty
in interface PersistentEntity<T,P extends PersistentProperty<P>>
PersistentEntity
.public void setIdProperty(P property)
MutablePersistentEntity
setIdProperty
in interface MutablePersistentEntity<T,P extends PersistentProperty<P>>
public Collection<P> getPersistentProperties()
PersistentEntity
getPersistentProperties
in interface PersistentEntity<T,P extends PersistentProperty<P>>
public void addPersistentProperty(P property)
MutablePersistentEntity
PersistentProperty
to the entity.
addPersistentProperty
in interface MutablePersistentEntity<T,P extends PersistentProperty<P>>
public Collection<Association<P>> getAssociations()
PersistentEntity
PersistentEntity.getPersistentProperties()
getAssociations
in interface PersistentEntity<T,P extends PersistentProperty<P>>
public void addAssociation(Association<P> association)
MutablePersistentEntity
Association
to the entity.
addAssociation
in interface MutablePersistentEntity<T,P extends PersistentProperty<P>>
public P getPersistentProperty(String name)
PersistentEntity
getPersistentProperty
in interface PersistentEntity<T,P extends PersistentProperty<P>>
name
- The name of the property
public Class<T> getType()
getType
in interface PersistentEntity<T,P extends PersistentProperty<P>>
public TypeInformation<T> getTypeInformation()
getTypeInformation
in interface PersistentEntity<T,P extends PersistentProperty<P>>
public Collection<String> getPersistentPropertyNames()
PersistentEntity
getPersistentPropertyNames
in interface PersistentEntity<T,P extends PersistentProperty<P>>
public void doWithProperties(PropertyHandler<P> handler)
doWithProperties
in interface PersistentEntity<T,P extends PersistentProperty<P>>
public void doWithAssociations(AssociationHandler<P> handler)
doWithAssociations
in interface PersistentEntity<T,P extends PersistentProperty<P>>
public void verify()
MutablePersistentEntity
PersistentEntity
. As
MutablePersistentEntity
is not immutable there might be some
verification steps necessary after the object has reached is final state.
verify
in interface MutablePersistentEntity<T,P extends PersistentProperty<P>>
|
Spring Data Commons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |