D
то
Post post = new Post();
postRepository.save(post);
ExecutorService executor = Executors.newFixedThreadPool(THREAD_COUNT);
for (i = 1; i<20;i++){
executor.submit(
() -> {
PostComment postComment1 = new PostComment();
postComment1.setPost(post)
postCommentRepository.save(postComment1)
}
}
(каскады в отношениях можно не указывать?)