#66 changed from Set to List

This commit is contained in:
Nightblade73 2019-04-16 09:51:31 +04:00
parent 735cbb5f7b
commit fbf9a7943b
2 changed files with 13 additions and 13 deletions

View File

@ -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<Paper> papers = new HashSet<>();
private List<Paper> 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<Paper> getPapers() {
public List<Paper> getPapers() {
return papers;
}
public void setPapers(Set<Paper> papers) {
public void setPapers(List<Paper> papers) {
this.papers = papers;
}

View File

@ -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<Deadline> deadlines = new ArrayList<>();
private List<Integer> removedDeadlineIds = new ArrayList<>();
private Set<Integer> userIds = new HashSet<>();
private Set<Integer> paperIds = new HashSet<>();
private Set<PaperDto> papers = new HashSet<>();
private List<Integer> paperIds = new ArrayList<>();
private List<Paper> papers = new ArrayList<>();
private Set<UserDto> users = new HashSet<>();
private Integer filterUserId;
@ -57,9 +57,9 @@ public class ConferenceDto {
@JsonProperty("endDate") Date endDate,
@JsonProperty("deadlines") List<Deadline> deadlines,
@JsonProperty("userIds") Set<Integer> userIds,
@JsonProperty("paperIds") Set<Integer> paperIds,
@JsonProperty("paperIds") List<Integer> paperIds,
@JsonProperty("users") Set<UserDto> users,
@JsonProperty("papers") Set<PaperDto> papers) {
@JsonProperty("papers") List<Paper> 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<Integer> getPaperIds() {
public List<Integer> getPaperIds() {
return paperIds;
}
public void setPaperIds(Set<Integer> paperIds) {
public void setPaperIds(List<Integer> paperIds) {
this.paperIds = paperIds;
}
public Set<PaperDto> getPapers() {
public List<Paper> getPapers() {
return papers;
}
public void setPapers(Set<PaperDto> papers) {
public void setPapers(List<Paper> papers) {
this.papers = papers;
}