Skip to content

Commit

Permalink
Keep backwards compatibility for MapPool
Browse files Browse the repository at this point in the history
  • Loading branch information
Brutus5000 committed Mar 16, 2021
1 parent 04ca187 commit 75eea58
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/main/java/com/faforever/api/data/domain/MapPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
Expand All @@ -25,6 +28,9 @@
public class MapPool extends AbstractEntity {
private String name;
private MatchmakerQueueMapPool matchmakerQueueMapPool;
@Deprecated
// Scheduled for removal once Downlord's FAF Client v1.4.3 or higher is widely adopted
private Set<MapVersion> mapVersions;
private Set<MapPoolAssignment> mapPoolAssignments;

@NotNull
Expand All @@ -37,8 +43,21 @@ public MatchmakerQueueMapPool getMatchmakerQueueMapPool() {
return matchmakerQueueMapPool;
}

@ManyToMany
@JoinTable(name = "map_pool_map_version",
joinColumns = @JoinColumn(name = "map_pool_id"),
inverseJoinColumns = @JoinColumn(name = "map_version_id")
)
@NotNull
@Deprecated
// Scheduled for removal once Downlord's FAF Client v1.4.3 or higher is widely adopted
public Set<MapVersion> getMapVersions() {
return mapVersions;
}

@OneToMany(mappedBy = "mapPool", cascade = CascadeType.ALL, orphanRemoval = true)
public Set<MapPoolAssignment> getMapPoolAssignments() {
return mapPoolAssignments;
}

}

0 comments on commit 75eea58

Please sign in to comment.