Vineet Sharma
Vineet Sharma

Reputation: 61

@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?

Upvotes: 6

Views: 5059

Answers (1)

Maciej Walkowiak
Maciej Walkowiak

Reputation: 12932

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

Upvotes: 9

Related Questions