-
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.
Add MapReviewsSummary and ModReviewsSummary
Also remove deprecated attributes numberOfReviews and averageReviewScore
- Loading branch information
1 parent
310ab43
commit 5ceaa8c
Showing
6 changed files
with
174 additions
and
33 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
70 changes: 70 additions & 0 deletions
70
src/main/java/com/faforever/api/data/domain/MapReviewsSummary.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,70 @@ | ||
package com.faforever.api.data.domain; | ||
|
||
import com.yahoo.elide.annotation.Include; | ||
import lombok.Setter; | ||
import org.hibernate.annotations.BatchSize; | ||
import org.hibernate.annotations.Immutable; | ||
|
||
import javax.annotation.Nullable; | ||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.FetchType; | ||
import javax.persistence.Id; | ||
import javax.persistence.JoinColumn; | ||
import javax.persistence.OneToOne; | ||
import javax.persistence.Table; | ||
|
||
@Entity | ||
@Setter | ||
@Table(name = "map_reviews_summary") | ||
@Include(type = "mapReviewsSummary") | ||
@Immutable | ||
public class MapReviewsSummary { | ||
private int id; | ||
private float positive; | ||
private float negative; | ||
private float score; | ||
private int reviews; | ||
@Nullable | ||
private Float lowerBound; | ||
private Map map; | ||
|
||
@Id | ||
@Column(name = "id") | ||
public int getId() { | ||
return id; | ||
} | ||
|
||
@Column(name = "positive") | ||
public float getPositive() { | ||
return positive; | ||
} | ||
|
||
@Column(name = "negative") | ||
public float getNegative() { | ||
return negative; | ||
} | ||
|
||
@Column(name = "score") | ||
public float getScore() { | ||
return score; | ||
} | ||
|
||
@Column(name = "reviews") | ||
public int getReviews() { | ||
return reviews; | ||
} | ||
|
||
@Column(name = "lower_bound") | ||
@Nullable | ||
public Float getLowerBound() { | ||
return lowerBound; | ||
} | ||
|
||
@OneToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "map_id", insertable = false, updatable = false) | ||
@BatchSize(size = 1000) | ||
public Map getMap() { | ||
return map; | ||
} | ||
} |
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
70 changes: 70 additions & 0 deletions
70
src/main/java/com/faforever/api/data/domain/ModReviewsSummary.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,70 @@ | ||
package com.faforever.api.data.domain; | ||
|
||
import com.yahoo.elide.annotation.Include; | ||
import lombok.Setter; | ||
import org.hibernate.annotations.BatchSize; | ||
import org.hibernate.annotations.Immutable; | ||
|
||
import javax.annotation.Nullable; | ||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.FetchType; | ||
import javax.persistence.Id; | ||
import javax.persistence.JoinColumn; | ||
import javax.persistence.OneToOne; | ||
import javax.persistence.Table; | ||
|
||
@Entity | ||
@Setter | ||
@Table(name = "mod_reviews_summary") | ||
@Include(type = "modReviewsSummary") | ||
@Immutable | ||
public class ModReviewsSummary { | ||
private int id; | ||
private float positive; | ||
private float negative; | ||
private float score; | ||
private int reviews; | ||
@Nullable | ||
private Float lowerBound; | ||
private Mod mod; | ||
|
||
@Id | ||
@Column(name = "id") | ||
public int getId() { | ||
return id; | ||
} | ||
|
||
@Column(name = "positive") | ||
public float getPositive() { | ||
return positive; | ||
} | ||
|
||
@Column(name = "negative") | ||
public float getNegative() { | ||
return negative; | ||
} | ||
|
||
@Column(name = "score") | ||
public float getScore() { | ||
return score; | ||
} | ||
|
||
@Column(name = "reviews") | ||
public int getReviews() { | ||
return reviews; | ||
} | ||
|
||
@Column(name = "lower_bound") | ||
@Nullable | ||
public Float getLowerBound() { | ||
return lowerBound; | ||
} | ||
|
||
@OneToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "mod_id", insertable = false, updatable = false) | ||
@BatchSize(size = 1000) | ||
public Mod getMod() { | ||
return mod; | ||
} | ||
} |
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