Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

@DbRef is not saving child object automatically in spring data mongodb

I am currently using GA release of Spring Data MongoDB framework and @DbRef is not saving child object automatically in spring data mongodb. Can you tell me how can i make it work?

like image 585
Vineet Sharma Avatar asked Apr 25 '12 14:04

Vineet Sharma


1 Answers

Saving child objects is not built into Spring Data MongoDB so you have to do it manually or you can extend AbstractMongoEventListener as I described it in my article: Spring Data MongoDB cascade save on DBRef objects

like image 123
Maciej Walkowiak Avatar answered Nov 13 '22 22:11

Maciej Walkowiak