User.java 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. * Copyright 2002-2016 the original author or authors.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package sample.domain;
  17. import java.io.Serializable;
  18. import java.util.Date;
  19. import javax.persistence.Basic;
  20. import javax.persistence.Entity;
  21. import javax.persistence.GeneratedValue;
  22. import javax.persistence.GenerationType;
  23. import javax.persistence.Id;
  24. import javax.persistence.NamedQuery;
  25. /**
  26. * The Class Patient.
  27. */
  28. @Entity
  29. @NamedQuery(name = "User.findByUsername", query = "from User where username= :username")
  30. public class User implements Serializable {
  31. /** serialVersionUID */
  32. private static final long serialVersionUID = 7073017148588882593L;
  33. /** The id. */
  34. @Id
  35. @GeneratedValue(strategy=GenerationType.IDENTITY)
  36. private Long id;
  37. /** The username. */
  38. @Basic(optional = false)
  39. private String username;
  40. /** The username. */
  41. @Basic(optional = false)
  42. private String password;
  43. /**
  44. * Default constructor
  45. */
  46. public User() {
  47. super();
  48. }
  49. /**
  50. * @param username
  51. * @param password
  52. */
  53. public User(String username, String password) {
  54. super();
  55. this.username = username;
  56. this.password = password;
  57. }
  58. /**
  59. * @return the id
  60. */
  61. public Long getId() {
  62. return id;
  63. }
  64. /**
  65. * @param id the id to set
  66. */
  67. public void setId(Long id) {
  68. this.id = id;
  69. }
  70. /**
  71. * @return the username
  72. */
  73. public String getUsername() {
  74. return username;
  75. }
  76. /**
  77. * @param username the username to set
  78. */
  79. public void setUsername(String username) {
  80. this.username = username;
  81. }
  82. /**
  83. * Full constructor
  84. * @param username
  85. */
  86. public User(String username, String password, Date derniereConnexion,
  87. String key) {
  88. super();
  89. this.username = username;
  90. }
  91. /**
  92. * @return the password
  93. */
  94. public String getPassword() {
  95. return password;
  96. }
  97. /**
  98. * @param password the password to set
  99. */
  100. public void setPassword(String password) {
  101. this.password = password;
  102. }
  103. }