From fbf9a7943b69c4de8a998750659b81d7f56b0d80 Mon Sep 17 00:00:00 2001 From: Nightblade73 Date: Tue, 16 Apr 2019 09:51:31 +0400 Subject: [PATCH] #66 changed from Set to List --- .../ru/ulstu/conference/model/Conference.java | 6 +++--- .../ulstu/conference/model/ConferenceDto.java | 20 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/ru/ulstu/conference/model/Conference.java b/src/main/java/ru/ulstu/conference/model/Conference.java index faed15c..b6affcd 100644 --- a/src/main/java/ru/ulstu/conference/model/Conference.java +++ b/src/main/java/ru/ulstu/conference/model/Conference.java @@ -60,7 +60,7 @@ public class Conference extends BaseEntity { @JoinTable(name = "paper_conference", joinColumns = {@JoinColumn(name = "conference_id")}, inverseJoinColumns = {@JoinColumn(name = "paper_id")}) - private Set papers = new HashSet<>(); + private List papers = new ArrayList<>(); @ManyToMany(fetch = FetchType.EAGER) @JoinTable(name = "users_conference", @@ -124,11 +124,11 @@ public class Conference extends BaseEntity { this.deadlines = deadlines; } - public Set getPapers() { + public List getPapers() { return papers; } - public void setPapers(Set papers) { + public void setPapers(List papers) { this.papers = papers; } diff --git a/src/main/java/ru/ulstu/conference/model/ConferenceDto.java b/src/main/java/ru/ulstu/conference/model/ConferenceDto.java index e5efcde..9e6e26d 100644 --- a/src/main/java/ru/ulstu/conference/model/ConferenceDto.java +++ b/src/main/java/ru/ulstu/conference/model/ConferenceDto.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import org.hibernate.validator.constraints.NotEmpty; import org.springframework.format.annotation.DateTimeFormat; import ru.ulstu.deadline.model.Deadline; -import ru.ulstu.paper.model.PaperDto; +import ru.ulstu.paper.model.Paper; import ru.ulstu.user.model.UserDto; import javax.persistence.Temporal; @@ -39,8 +39,8 @@ public class ConferenceDto { private List deadlines = new ArrayList<>(); private List removedDeadlineIds = new ArrayList<>(); private Set userIds = new HashSet<>(); - private Set paperIds = new HashSet<>(); - private Set papers = new HashSet<>(); + private List paperIds = new ArrayList<>(); + private List papers = new ArrayList<>(); private Set users = new HashSet<>(); private Integer filterUserId; @@ -57,9 +57,9 @@ public class ConferenceDto { @JsonProperty("endDate") Date endDate, @JsonProperty("deadlines") List deadlines, @JsonProperty("userIds") Set userIds, - @JsonProperty("paperIds") Set paperIds, + @JsonProperty("paperIds") List paperIds, @JsonProperty("users") Set users, - @JsonProperty("papers") Set papers) { + @JsonProperty("papers") List papers) { this.id = id; this.title = title; this.description = description; @@ -86,7 +86,7 @@ public class ConferenceDto { this.userIds = convert(conference.getUsers(), user -> user.getId()); this.paperIds = convert(conference.getPapers(), paper -> paper.getId()); this.users = convert(conference.getUsers(), UserDto::new); - this.papers = convert(conference.getPapers(), PaperDto::new); + this.papers = conference.getPapers(); } @@ -162,19 +162,19 @@ public class ConferenceDto { this.userIds = userIds; } - public Set getPaperIds() { + public List getPaperIds() { return paperIds; } - public void setPaperIds(Set paperIds) { + public void setPaperIds(List paperIds) { this.paperIds = paperIds; } - public Set getPapers() { + public List getPapers() { return papers; } - public void setPapers(Set papers) { + public void setPapers(List papers) { this.papers = papers; }