Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.castlesbattles.model.to;
- import org.hibernate.annotations.Cascade;
- import javax.persistence.*;
- import java.util.List;
- /**
- * Created by Reza on 1/29/2016.
- */
- @Entity
- @javax.persistence.Table(name = "player", schema = "castles_battles", catalog = "")
- public class PlayerEntity {
- private int id;
- private String username;
- private String password;
- private String deviceId;
- private String email;
- private String loginToken;
- private long registerTime;
- private long lastLoginTime;
- private String notificationToken;
- private String deviceName;
- private String deviceModel;
- private int androidApiVersion;
- private int appVersion;
- private String advisingCode;
- private int money;
- private int xp;
- private int level;
- private int totalRating;
- private int totalGamePlayed;
- private int totalWinRatio;
- private int weeklyRating;
- private int totalLoot;
- private int winDefences;
- private int gemsPurchased;
- private int gemsUsed;
- private String singlePlayerData;
- private boolean realPlayer;
- private String extraData;
- private boolean banned;
- private String banReason;
- private List<TownEntity> towns;
- private List<MessageEntity> messages;
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- @javax.persistence.Column(name = "id", nullable = false)
- public int getId() {
- return id;
- }
- public void setId(int id) {
- this.id = id;
- }
- @Basic
- @javax.persistence.Column(name = "username", nullable = true, length = 50)
- public String getUsername() {
- return username;
- }
- public void setUsername(String username) {
- this.username = username;
- }
- @Basic
- @javax.persistence.Column(name = "password", nullable = true, length = 256)
- public String getPassword() {
- return password;
- }
- public void setPassword(String password) {
- this.password = password;
- }
- @Basic
- @javax.persistence.Column(name = "device_id", unique = true, nullable = true, length = 45)
- public String getDeviceId() {
- return deviceId;
- }
- public void setDeviceId(String deviceId) {
- this.deviceId = deviceId;
- }
- @Basic
- @javax.persistence.Column(name = "email", nullable = true, length = 45)
- public String getEmail() {
- return email;
- }
- public void setEmail(String email) {
- this.email = email;
- }
- @Basic
- @javax.persistence.Column(name = "login_token", nullable = true, length = 300)
- public String getLoginToken() {
- return loginToken;
- }
- public void setLoginToken(String loginToken) {
- this.loginToken = loginToken;
- }
- @Basic
- @javax.persistence.Column(name = "register_time", nullable = true)
- public long getRegisterTime() {
- return registerTime;
- }
- public void setRegisterTime(long registerTime) {
- this.registerTime = registerTime;
- }
- @Basic
- @javax.persistence.Column(name = "last_login_time", nullable = true)
- public long getLastLoginTime() {
- return lastLoginTime;
- }
- public void setLastLoginTime(long lastLoginTime) {
- this.lastLoginTime = lastLoginTime;
- }
- @Basic
- @javax.persistence.Column(name = "notification_token", nullable = true, length = 300)
- public String getNotificationToken() {
- return notificationToken;
- }
- public void setNotificationToken(String notificationToken) {
- this.notificationToken = notificationToken;
- }
- @Basic
- @javax.persistence.Column(name = "device_name", nullable = true, length = 45)
- public String getDeviceName() {
- return deviceName;
- }
- public void setDeviceName(String deviceName) {
- this.deviceName = deviceName;
- }
- @Basic
- @javax.persistence.Column(name = "device_model", nullable = true, length = 45)
- public String getDeviceModel() {
- return deviceModel;
- }
- public void setDeviceModel(String deviceModel) {
- this.deviceModel = deviceModel;
- }
- @Basic
- @javax.persistence.Column(name = "android_api_version", nullable = true)
- public int getAndroidApiVersion() {
- return androidApiVersion;
- }
- public void setAndroidApiVersion(int androidApiVersion) {
- this.androidApiVersion = androidApiVersion;
- }
- @Basic
- @javax.persistence.Column(name = "app_version", nullable = true)
- public int getAppVersion() {
- return appVersion;
- }
- public void setAppVersion(int appVersion) {
- this.appVersion = appVersion;
- }
- @Basic
- @javax.persistence.Column(name = "advising_code", nullable = true, length = 20)
- public String getAdvisingCode() {
- return advisingCode;
- }
- public void setAdvisingCode(String advisingCode) {
- this.advisingCode = advisingCode;
- }
- @Basic
- @javax.persistence.Column(name = "money", nullable = true)
- public int getMoney() {
- return money;
- }
- public void setMoney(int money) {
- this.money = money;
- }
- @Basic
- @javax.persistence.Column(name = "xp", nullable = true)
- public int getXp() {
- return xp;
- }
- public void setXp(int xp) {
- this.xp = xp;
- }
- @Basic
- @javax.persistence.Column(name = "level", nullable = true)
- public int getLevel() {
- return level;
- }
- public void setLevel(int level) {
- this.level = level;
- }
- @Basic
- @javax.persistence.Column(name = "total_rating", nullable = true)
- public int getTotalRating() {
- return totalRating;
- }
- public void setTotalRating(int totalRating) {
- this.totalRating = totalRating;
- }
- @Basic
- @javax.persistence.Column(name = "total_game_played", nullable = true)
- public int getTotalGamePlayed() {
- return totalGamePlayed;
- }
- public void setTotalGamePlayed(int totalGamePlayed) {
- this.totalGamePlayed = totalGamePlayed;
- }
- @Basic
- @javax.persistence.Column(name = "total_win_ratio", nullable = true)
- public int getTotalWinRatio() {
- return totalWinRatio;
- }
- public void setTotalWinRatio(int totalWinRatio) {
- this.totalWinRatio = totalWinRatio;
- }
- @Basic
- @javax.persistence.Column(name = "weekly_rating", nullable = true)
- public int getWeeklyRating() {
- return weeklyRating;
- }
- public void setWeeklyRating(int weeklyRating) {
- this.weeklyRating = weeklyRating;
- }
- @Basic
- @javax.persistence.Column(name = "total_loot", nullable = true)
- public int getTotalLoot() {
- return totalLoot;
- }
- public void setTotalLoot(int totalLoot) {
- this.totalLoot = totalLoot;
- }
- @Basic
- @javax.persistence.Column(name = "win_defences", nullable = true)
- public int getWinDefences() {
- return winDefences;
- }
- public void setWinDefences(int winDefences) {
- this.winDefences = winDefences;
- }
- @Basic
- @javax.persistence.Column(name = "gems_purchased", nullable = true)
- public int getGemsPurchased() {
- return gemsPurchased;
- }
- public void setGemsPurchased(int gemsPurchased) {
- this.gemsPurchased = gemsPurchased;
- }
- @Basic
- @javax.persistence.Column(name = "gems_used", nullable = true)
- public int getGemsUsed() {
- return gemsUsed;
- }
- public void setGemsUsed(int gemsUsed) {
- this.gemsUsed = gemsUsed;
- }
- @Basic
- @javax.persistence.Column(name = "single_player_data", nullable = true, length = 4096)
- public String getSinglePlayerData() {
- return singlePlayerData;
- }
- public void setSinglePlayerData(String singlePlayerData) {
- this.singlePlayerData = singlePlayerData;
- }
- @Basic
- @javax.persistence.Column(name = "real_player", nullable = true)
- public boolean isRealPlayer() {
- return realPlayer;
- }
- public void setRealPlayer(boolean realPlayer) {
- this.realPlayer = realPlayer;
- }
- @Basic
- @javax.persistence.Column(name = "extra_data", nullable = true, length = 2048)
- public String getExtraData() {
- return extraData;
- }
- public void setExtraData(String extraData) {
- this.extraData = extraData;
- }
- @Basic
- @javax.persistence.Column(name = "banned", nullable = true)
- public boolean isBanned() {
- return banned;
- }
- public void setBanned(boolean banned) {
- this.banned = banned;
- }
- @Basic
- @javax.persistence.Column(name = "ban_reason", nullable = true, length = 500)
- public String getBanReason() {
- return banReason;
- }
- public void setBanReason(String banReason) {
- this.banReason = banReason;
- }
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- PlayerEntity that = (PlayerEntity) o;
- if (id != that.id) return false;
- if (money != that.money) return false;
- if (xp != that.xp) return false;
- if (level != that.level) return false;
- if (totalRating != that.totalRating) return false;
- if (totalGamePlayed != that.totalGamePlayed) return false;
- if (totalWinRatio != that.totalWinRatio) return false;
- if (weeklyRating != that.weeklyRating) return false;
- if (totalLoot != that.totalLoot) return false;
- if (winDefences != that.winDefences) return false;
- if (gemsPurchased != that.gemsPurchased) return false;
- if (gemsUsed != that.gemsUsed) return false;
- if (realPlayer != that.realPlayer) return false;
- if (banned != that.banned) return false;
- if (username != null ? !username.equals(that.username) : that.username != null) return false;
- if (password != null ? !password.equals(that.password) : that.password != null) return false;
- if (deviceId != null ? !deviceId.equals(that.deviceId) : that.deviceId != null) return false;
- if (email != null ? !email.equals(that.email) : that.email != null) return false;
- if (loginToken != null ? !loginToken.equals(that.loginToken) : that.loginToken != null) return false;
- if (notificationToken != null ? !notificationToken.equals(that.notificationToken) : that.notificationToken != null)
- return false;
- if (advisingCode != null ? !advisingCode.equals(that.advisingCode) : that.advisingCode != null) return false;
- if (singlePlayerData != null ? !singlePlayerData.equals(that.singlePlayerData) : that.singlePlayerData != null)
- return false;
- if (extraData != null ? !extraData.equals(that.extraData) : that.extraData != null) return false;
- if (banReason != null ? !banReason.equals(that.banReason) : that.banReason != null) return false;
- return true;
- }
- @Override
- public int hashCode() {
- int result = id;
- result = 31 * result + (username != null ? username.hashCode() : 0);
- result = 31 * result + (password != null ? password.hashCode() : 0);
- result = 31 * result + (deviceId != null ? deviceId.hashCode() : 0);
- result = 31 * result + (email != null ? email.hashCode() : 0);
- result = 31 * result + (loginToken != null ? loginToken.hashCode() : 0);
- result = 31 * result + (notificationToken != null ? notificationToken.hashCode() : 0);
- result = 31 * result + (advisingCode != null ? advisingCode.hashCode() : 0);
- result = 31 * result + money;
- result = 31 * result + xp;
- result = 31 * result + level;
- result = 31 * result + totalRating;
- result = 31 * result + totalGamePlayed;
- result = 31 * result + totalWinRatio;
- result = 31 * result + weeklyRating;
- result = 31 * result + totalLoot;
- result = 31 * result + winDefences;
- result = 31 * result + gemsPurchased;
- result = 31 * result + gemsUsed;
- result = 31 * result + (singlePlayerData != null ? singlePlayerData.hashCode() : 0);
- result = 31 * result + (realPlayer ? 1 : 0);
- result = 31 * result + (extraData != null ? extraData.hashCode() : 0);
- result = 31 * result + (banned ? 1 : 0);
- result = 31 * result + (banReason != null ? banReason.hashCode() : 0);
- return result;
- }
- @OneToMany(mappedBy = "player", cascade = CascadeType.ALL)
- @Cascade(org.hibernate.annotations.CascadeType.ALL)
- public List<TownEntity> getTowns() {
- return towns;
- }
- public void setTowns(List<TownEntity> towns) {
- this.towns = towns;
- }
- @OneToMany(mappedBy = "player", cascade = CascadeType.ALL)
- @Cascade(org.hibernate.annotations.CascadeType.ALL)
- public List<MessageEntity> getMessages() {
- return messages;
- }
- public void setMessages(List<MessageEntity> messages) {
- this.messages = messages;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement