Advertisement
Guest User

Untitled

a guest
Mar 27th, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. package pl.transition.chda.model;
  2.  
  3. import com.j256.ormlite.dao.ForeignCollection;
  4. import com.j256.ormlite.field.DatabaseField;
  5. import com.j256.ormlite.field.ForeignCollectionField;
  6. import com.j256.ormlite.table.DatabaseTable;
  7.  
  8.  
  9. public abstract class Principal {
  10.  
  11. private Object principal;
  12.  
  13. @DatabaseField(generatedId = true)
  14. private int id;
  15.  
  16. @DatabaseField(canBeNull = false, unique = true)
  17. private String userName;
  18.  
  19. @DatabaseField(canBeNull = false)
  20. private String password;
  21.  
  22. @DatabaseField()
  23. private String email;
  24.  
  25. @DatabaseField()
  26. private boolean isAdmin;
  27.  
  28. @ForeignCollectionField(foreignFieldName = "creator")
  29. private ForeignCollection<BusinessObject> createdChangeNotice;
  30.  
  31. @ForeignCollectionField(foreignFieldName = "modifier")
  32. private ForeignCollection<BusinessObject> modifiedChangeNotice;
  33.  
  34. @ForeignCollectionField(foreignFieldName = "creator")
  35. private ForeignCollection<ChangeRequest> createdChangeRequest;
  36.  
  37. @ForeignCollectionField(foreignFieldName = "modifier")
  38. private ForeignCollection<ChangeRequest> modifiedChangeRequested;
  39.  
  40. @ForeignCollectionField(foreignFieldName = "creator")
  41. private ForeignCollection<Part> createdParts;
  42.  
  43. @ForeignCollectionField(foreignFieldName = "modifier")
  44. private ForeignCollection<Part> modifiedParts;
  45.  
  46. @ForeignCollectionField(foreignFieldName = "creator")
  47. private ForeignCollection<ProblemReport> createdProblemReports;
  48.  
  49. @ForeignCollectionField(foreignFieldName = "modifier")
  50. private ForeignCollection<ProblemReport> modifierdProblemReports;
  51.  
  52.  
  53. public Principal(){
  54.  
  55. }
  56.  
  57. public Principal(Object principal) {
  58. this.principal = principal;
  59. }
  60.  
  61. public Principal(String userName, String password, String email) {
  62. this.userName = userName;
  63. this.password = password;
  64. this.email = email;
  65. this.isAdmin = false;
  66. }
  67.  
  68. protected Object getPrincipal() {
  69. return this.principal;
  70. }
  71.  
  72. public int getId() {
  73. return id;
  74. }
  75.  
  76. public void setId(int id) {
  77. this.id = id;
  78. }
  79.  
  80. public String getUserName() {
  81. return userName;
  82. }
  83.  
  84. public void setUserName(String userName) {
  85. this.userName = userName;
  86. }
  87.  
  88. private String getPassword() {
  89. return password;
  90. }
  91.  
  92. public void setPassword(String password) {
  93. this.password = password;
  94. }
  95.  
  96. public String getEmail() {
  97. return email;
  98. }
  99.  
  100. public void setEmail(String email) {
  101. this.email = email;
  102. }
  103.  
  104. public boolean isAdmin() {
  105. return isAdmin;
  106. }
  107.  
  108. public void setAdmin(boolean isAdmin) {
  109. this.isAdmin = isAdmin;
  110. }
  111.  
  112. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement