Interface MutablePersistentEntity<T,P extends PersistentProperty<P>>
- All Superinterfaces:
Iterable<P>
,PersistentEntity<T,
P>
- All Known Implementing Classes:
BasicPersistentEntity
public interface MutablePersistentEntity<T,P extends PersistentProperty<P>>
extends PersistentEntity<T,P>
Interface capturing mutator methods for
PersistentEntity
s.- Author:
- Oliver Gierke, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAssociation
(Association<P> association) Adds anAssociation
to the entity.void
addPersistentProperty
(P property) Adds aPersistentProperty
to the entity.void
Sets theEvaluationContextProvider
to be used by the entity.void
Sets thePersistentPropertyAccessorFactory
for the entity.void
verify()
Callback method to trigger validation of thePersistentEntity
.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface org.springframework.data.mapping.PersistentEntity
doWithAll, doWithAssociations, doWithAssociations, doWithProperties, doWithProperties, findAnnotation, getIdentifierAccessor, getIdProperty, getInstanceCreatorMetadata, getName, getPersistenceConstructor, getPersistentProperties, getPersistentProperty, getPersistentProperty, getPropertyAccessor, getPropertyPathAccessor, getRequiredAnnotation, getRequiredIdProperty, getRequiredPersistentProperty, getRequiredVersionProperty, getType, getTypeAlias, getTypeInformation, getVersionProperty, hasIdProperty, hasVersionProperty, isAnnotationPresent, isConstructorArgument, isCreatorArgument, isIdProperty, isImmutable, isNew, isVersionProperty, requiresPropertyPopulation
-
Method Details
-
addPersistentProperty
Adds aPersistentProperty
to the entity.- Parameters:
property
-
-
addAssociation
Adds anAssociation
to the entity.- Parameters:
association
-
-
verify
Callback method to trigger validation of thePersistentEntity
. AsMutablePersistentEntity
is not immutable there might be some verification steps necessary after the object has reached is final state.- Throws:
MappingException
- in case the entity is invalid
-
setPersistentPropertyAccessorFactory
Sets thePersistentPropertyAccessorFactory
for the entity. APersistentPropertyAccessorFactory
createsPersistentPropertyAccessor
s for instances of this entity.- Parameters:
factory
- must not be null.
-
setEvaluationContextProvider
Sets theEvaluationContextProvider
to be used by the entity.- Parameters:
provider
- must not be null.
-