Class ContactsRepositoryImpl
java.lang.Object
info.ejava.examples.db.validation.contacts.repo.ContactsRepositoryImpl
- All Implemented Interfaces:
org.springframework.data.mapping.callback.EntityCallback<PersonPOC>,org.springframework.data.mongodb.core.mapping.event.BeforeConvertCallback<PersonPOC>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidnameContactPoints(Collection<ContactPoint> contactPoints) onBeforeConvert(PersonPOC poc, String collection) MongoRepository only assigns a unique ID to the root Document.
-
Constructor Details
-
ContactsRepositoryImpl
public ContactsRepositoryImpl()
-
-
Method Details
-
onBeforeConvert
MongoRepository only assigns a unique ID to the root Document. We must assign all nested child IDs. This callback is registered to handle change events when the root document with children are inserted or saved.- Specified by:
onBeforeConvertin interfaceorg.springframework.data.mongodb.core.mapping.event.BeforeConvertCallback<PersonPOC>- Parameters:
poc-collection-- Returns:
- poc with child IDs assigned
-
nameContactPoints
-