Added event on saving User cascade save EmailAddress
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package org.baeldung.config;
|
||||
|
||||
import org.baeldung.event.CascadingMongoEventListener;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.mongodb.config.AbstractMongoConfiguration;
|
||||
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
|
||||
@@ -25,4 +27,9 @@ public class MongoConfig extends AbstractMongoConfiguration {
|
||||
public String getMappingBasePackage() {
|
||||
return "org.baeldung";
|
||||
}
|
||||
|
||||
@Bean
|
||||
public CascadingMongoEventListener cascadingMongoEventListener(){
|
||||
return new CascadingMongoEventListener();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user