-
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.
- Loading branch information
Showing
3 changed files
with
103 additions
and
0 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
68 changes: 68 additions & 0 deletions
68
src/main/java/com/faforever/api/data/domain/AvatarAssignment.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,68 @@ | ||
package com.faforever.api.data.domain; | ||
|
||
import com.yahoo.elide.annotation.Include; | ||
import lombok.Setter; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.FetchType; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import javax.persistence.JoinColumn; | ||
import javax.persistence.ManyToOne; | ||
import javax.persistence.Table; | ||
import java.time.OffsetDateTime; | ||
|
||
@Entity | ||
@Table(name = "avatars") | ||
@Include(rootLevel = true, type = "avatarAssignment") | ||
@Setter | ||
public class AvatarAssignment { | ||
private int id; | ||
private OffsetDateTime createTime; | ||
private OffsetDateTime updateTime; | ||
private boolean selected; | ||
private OffsetDateTime expiresAt; | ||
private Player player; | ||
private Avatar avatar; | ||
|
||
@Column(name = "selected") | ||
public boolean isSelected() { | ||
return selected; | ||
} | ||
|
||
@Column(name = "expires_at") | ||
public OffsetDateTime getExpiresAt() { | ||
return expiresAt; | ||
} | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "idAvatar") | ||
public Avatar getAvatar() { | ||
return avatar; | ||
} | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "idUser") | ||
public Player getPlayer() { | ||
return player; | ||
} | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "id") | ||
public int getId() { | ||
return id; | ||
} | ||
|
||
@Column(name = "create_time") | ||
public OffsetDateTime getCreateTime() { | ||
return createTime; | ||
} | ||
|
||
@Column(name = "update_time") | ||
public OffsetDateTime getUpdateTime() { | ||
return updateTime; | ||
} | ||
} |
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