-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve MapPool->MapVersion relation into new entity
- Loading branch information
1 parent
28128cc
commit 04ca187
Showing
6 changed files
with
105 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
src/main/java/com/faforever/api/data/domain/MapPoolAssignment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package com.faforever.api.data.domain; | ||
|
||
import com.faforever.api.security.elide.permission.WriteMatchmakerMapCheck; | ||
import com.yahoo.elide.annotation.CreatePermission; | ||
import com.yahoo.elide.annotation.DeletePermission; | ||
import com.yahoo.elide.annotation.Include; | ||
import com.yahoo.elide.annotation.UpdatePermission; | ||
import lombok.Setter; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.json.JSONObject; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
|
||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import javax.persistence.JoinColumn; | ||
|
||
import javax.persistence.OneToOne; | ||
import javax.persistence.Table; | ||
|
||
|
||
@Entity | ||
@Setter | ||
@Table(name = "map_pool_map_version") | ||
@Include(rootLevel = true, type = "mapPoolAssignment") | ||
@CreatePermission(expression = WriteMatchmakerMapCheck.EXPRESSION) | ||
@UpdatePermission(expression = WriteMatchmakerMapCheck.EXPRESSION) | ||
@DeletePermission(expression = WriteMatchmakerMapCheck.EXPRESSION) | ||
public class MapPoolAssignment extends AbstractEntity { | ||
private MapPool mapPool; | ||
private MapVersion mapVersion; | ||
private Integer weight; | ||
private String mapParams; | ||
|
||
@OneToOne | ||
@JoinColumn(name = "map_pool_id") | ||
@NotNull | ||
public MapPool getMapPool() { | ||
return mapPool; | ||
} | ||
|
||
@OneToOne | ||
@JoinColumn(name = "map_version_id") | ||
public MapVersion getMapVersion() { | ||
return mapVersion; | ||
} | ||
|
||
@Column(name = "weight") | ||
@NotNull | ||
public Integer getWeight() { | ||
return weight; | ||
} | ||
|
||
@Column(name = "map_params") | ||
public String getMapParams() { return mapParams; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters