Post
@Document(collection = "posts")
@Getter
@Setter
@NoArgsConstructor
public class Post {
@Id
private String id;
private Instant moment;
private String title;
private String body;
private Author author;
@Setter(AccessLevel.NONE)
private List<Comment> comments = new ArrayList<>();
public Post(String id, Instant moment, String title, String body, Author author) {
this.id = id;
this.moment = moment;
this.title = title;
this.body = body;
this.author = author;
}
}Atualizado