SHARE
TWEET

Persistence class

a guest Apr 10th, 2011 2,648 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.SySammy.sdRankingSys;
  2.  
  3. import com.avaje.ebean.validation.Length;
  4. import com.avaje.ebean.validation.NotEmpty;
  5. import com.avaje.ebean.validation.NotNull;
  6. import javax.persistence.Entity;
  7. import javax.persistence.Id;
  8. import javax.persistence.Table;
  9. import org.bukkit.Bukkit;
  10. import org.bukkit.entity.Player;
  11.  
  12. /**
  13.  *
  14.  * @author Sammy
  15.  */
  16. @Entity()
  17. @Table(name = "sd_ranks")
  18. public class Ranks {
  19.  
  20.     @Id
  21.     private int id;
  22.     @NotNull
  23.     private String playerName;
  24.     @Length(max = 30)
  25.     @NotEmpty
  26.     private String name;
  27.  
  28.     @NotEmpty
  29.     private String Test;
  30.  
  31.     public void setId(int id) {
  32.         this.id = id;
  33.     }
  34.  
  35.     public int getId() {
  36.         return id;
  37.     }
  38.  
  39.     public String getName() {
  40.         return name;
  41.     }
  42.  
  43.     public void setName(String name) {
  44.         this.name = name;
  45.     }
  46.  
  47.     public String getPlayerName() {
  48.         return playerName;
  49.     }
  50.  
  51.     public void setPlayerName(String ply) {
  52.         this.playerName = ply;
  53.     }
  54.  
  55.     public Player getPlayer() {
  56.         return Bukkit.getServer().getPlayer(playerName);
  57.     }
  58.  
  59.     public void setPlayer(Player player) {
  60.         this.playerName = player.getName();
  61.     }
  62.  
  63.     public String getTest(){
  64.         return Test;
  65.     }
  66.  
  67.     public void setTest(String test){
  68.         this.Test = test;
  69.     }
  70. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top