@Id
private String id;
private String name;
- @DBRef
- private List<MessageTo> messages;
public static ChatRoomTo from(ChatRoom chatroom)
{
return new ChatRoomTo(
chatroom.getId().toString(),
- chatroom.getName(),
- chatroom
- .getMessages()
- .map(MessageTo::from)
- .collectList()
- .block());
+ chatroom.getName());
}
}