// Path: src/main/java/org/fjorum/controller/form/ReplyCreateForm.java
// public class ReplyCreateForm {
// 
//     public final static String NAME = "replyCreateForm";
// 
//     @NotNull
//     private User user;
// 
//     @NotNull
//     private Topic topic;
// 
//     @NotEmpty
//     private String content = "";
// 
//     ReplyCreateForm(){}
// 
//     public ReplyCreateForm(User user, Topic topic) {
//         this.user = user;
//         this.topic = topic;
//     }
// 
//     public User getUser() {
//         return user;
//     }
// 
//     public void setUser(User user) {
//         this.user = user;
//     }
// 
//     public Topic getTopic() {
//         return topic;
//     }
// 
//     public void setTopic(Topic topic) {
//         this.topic = topic;
//     }
// 
//     public String getContent() {
//         return content;
//     }
// 
//     public void setContent(String content) {
//         this.content = content;
//     }
// }


import org.fjorum.controller.form.ReplyCreateForm;
import org.fjorum.model.entity.Reply;
import org.fjorum.model.entity.Topic;
import org.fjorum.model.entity.User;
import org.fjorum.model.repository.ReplyRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service;
import javax.validation.constraints.NotNull;
import java.util.Objects;
package org.fjorum.model.service;



@Service
public class ReplyServiceImpl extends AbstractEntityServiceImpl<Reply> implements ReplyService {

    private final ReplyRepository replyRepository;
    private final TopicService topicService;

    @Autowired
    public ReplyServiceImpl(ReplyRepository replyRepository,
                            TopicService topicService) {
        this.replyRepository = replyRepository;
        this.topicService = topicService;
    }


    @Override
    public Reply createNewReply(ReplyCreateForm form) {
// Path: src/main/java/org/fjorum/controller/form/ReplyCreateForm.java
// public class ReplyCreateForm {
// 
//     public final static String NAME = "replyCreateForm";
// 
//     @NotNull
//     private User user;
// 
//     @NotNull
//     private Topic topic;
// 
//     @NotEmpty
//     private String content = "";
// 
//     ReplyCreateForm(){}
// 
//     public ReplyCreateForm(User user, Topic topic) {
//         this.user = user;
//         this.topic = topic;
//     }
// 
//     public User getUser() {
//         return user;
//     }
// 
//     public void setUser(User user) {
//         this.user = user;
//     }
// 
//     public Topic getTopic() {
//         return topic;
//     }
// 
//     public void setTopic(Topic topic) {
//         this.topic = topic;
//     }
// 
//     public String getContent() {
//         return content;
//     }
// 
//     public void setContent(String content) {
//         this.content = content;
//     }
// }


// Path: src/main/java/org/fjorum/model/service/ReplyServiceImpl.java
import org.fjorum.controller.form.ReplyCreateForm;
import org.fjorum.model.entity.Reply;
import org.fjorum.model.entity.Topic;
import org.fjorum.model.entity.User;
import org.fjorum.model.repository.ReplyRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service;
import javax.validation.constraints.NotNull;
import java.util.Objects;

package org.fjorum.model.service;



@Service
public class ReplyServiceImpl extends AbstractEntityServiceImpl<Reply> implements ReplyService {

    private final ReplyRepository replyRepository;
    private final TopicService topicService;

    @Autowired
    public ReplyServiceImpl(ReplyRepository replyRepository,
                            TopicService topicService) {
        this.replyRepository = replyRepository;
        this.topicService = topicService;
    }


    @Override
    public Reply createNewReply(ReplyCreateForm form) {
        return createNewReply(form.getTopic(), form.getUser(), form.getContent());