use of io.micronaut.data.tck.entities.AuthorBooksDto in project micronaut-data by micronaut-projects.
the class BookRepository method saveAuthorBooks.
public void saveAuthorBooks(List<AuthorBooksDto> authorBooksDtos) {
List<Author> authors = new ArrayList<>();
for (AuthorBooksDto dto : authorBooksDtos) {
Author author = newAuthor(dto.getAuthorName());
authors.add(author);
for (BookDto book : dto.getBooks()) {
newBook(author, book.getTitle(), book.getTotalPages());
}
}
authorRepository.saveAll(authors);
}
Aggregations