Save an object with a list using Spring Crudrepository

Asked

Viewed 473 times

0

Hello, Is there any way to save an object with an object list (Set)? For example, I have the Artist and Album objects, Artist has a list of Albuns (Set). I would like when saving the Artist also save the list of Albuns together, which would already be populated. Or, I would have to first save the Artist, get the saved Artist ID and only then call the albumRepository to save the Albuns list.

  • Add classes and mapping to the question

1 answer

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.