Package database.entity
Class Leaderboard
java.lang.Object
database.entity.Leaderboard
Entity that is respoonsible mapping data to Leaderboard table in database.
This table contains all the scores of the players.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Accountaccountid is the foreign key of the table.private ModeTypeDifficulty of the played game.private intpoints of the score.private Longscoreid is the primary key of the table.private DoubleFinishing time of the game.private DateTimestamp of the score. -
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor required by HibernateLeaderboard(Account accountid, Double time, int points, ModeType difficulty, Date timestamp) Constructor for Leaderboard class. -
Method Summary
Modifier and TypeMethodDescriptionGetter for accountidvoidgetAccountid(Account userid) Setter for accountidGetter for difficultyintGetter for pointsGetter for scoreidgetTime()Getter for timeGetter for timestampvoidsetAccountid(Account accountid) Setter for accountidvoidsetDifficulty(ModeType difficulty) Setter for difficultyvoidsetPoints(int points) Setter for pointsvoidsetScoreid(Long scoreid) Setter for scoreidvoidSetter for timevoidsetTimestamp(Date timestamp) Setter for timestamptoString()toString method for Leaderboard class.
-
Field Details
-
scoreid
scoreid is the primary key of the table. It's generated automatically by the database. -
accountid
accountid is the foreign key of the table. It's used to connect the score to the account. Each account can have multiple scores. Each score can only belong to one account. -
time
Finishing time of the game. -
points
private int pointspoints of the score. -
difficulty
Difficulty of the played game. -
timestamp
Timestamp of the score.
-
-
Constructor Details
-
Leaderboard
public Leaderboard()Empty constructor required by Hibernate -
Leaderboard
Constructor for Leaderboard class.- Parameters:
accountid- - seeaccountidtime- - seetimedifficulty- - seedifficultytimestamp- - seetimestamp
-
-
Method Details
-
getTimestamp
Getter for timestamp- Returns:
- - see
timestamp
-
setTimestamp
Setter for timestamp- Parameters:
timestamp- - seetimestamp
-
getAccountid
Getter for accountid- Returns:
- - see
accountid
-
setAccountid
Setter for accountid- Parameters:
accountid- - seeaccountid
-
getAccountid
Setter for accountid- Parameters:
userid- - seeaccountid
-
getDifficulty
Getter for difficulty- Returns:
- - see
difficulty
-
setDifficulty
Setter for difficulty- Parameters:
difficulty- - seedifficulty
-
getTime
Getter for time- Returns:
- - see
time
-
setTime
Setter for time- Parameters:
seconds- - seetime
-
getScoreid
Getter for scoreid- Returns:
- - see
scoreid
-
setScoreid
Setter for scoreid- Parameters:
scoreid- - seescoreid
-
getPoints
public int getPoints()Getter for points- Returns:
- - see
points
-
setPoints
public void setPoints(int points) Setter for points- Parameters:
points- - seepoints
-
toString
toString method for Leaderboard class.
-