Changeset 7fafead in Git for src/main/java/com/wediscussmovies/project/model/User.java
- Timestamp:
- 01/16/22 20:22:55 (3 years ago)
- Branches:
- main
- Children:
- 3ded84d
- Parents:
- 2d57cad (diff), 7bc8942 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/wediscussmovies/project/model/User.java
r2d57cad r7fafead 3 3 import javax.persistence.*; 4 4 import java.util.Collection; 5 import java.util.List; 5 6 6 7 @Entity … … 10 11 @Id 11 12 @Column(name = "user_id") 12 private int userId; 13 @Basic 14 @Column(name = "username") 13 private Long userId; 14 15 15 private String username; 16 @Basic 17 @Column(name = "name") 16 18 17 private String name; 19 @Basic 20 @Column(name = "surname") 18 21 19 private String surname; 22 @Basic 23 @Column(name = "email") 20 24 21 private String email; 25 @Basic 26 @Column(name = "password") 22 27 23 private String password; 28 @OneToMany(mappedBy = "usersByUserId")29 private Collection<Discussion> discussionsByUserId;30 @OneToMany(mappedBy = "usersByUserId")31 private Collection<MovieLikesEntity> movieLikesByUserId;32 @OneToMany(mappedBy = "usersByUserId")33 private Collection<MovieRatesEntity> movieRatesByUserId;34 @OneToMany(mappedBy = "usersByUserId")35 private Collection<PersonRatesEntity> personRatesByUserId;36 @OneToMany(mappedBy = "usersByUserId")37 private Collection<Reply> repliesByUserId;38 @OneToMany(mappedBy = "usersByUserId")39 private Collection<UserGenresEntity> userGenresByUserId;40 24 41 public int getUserId() { 42 return userId; 43 } 25 @ManyToMany 26 private List<Movie> movies; 44 27 45 public void setUserId(int userId) {46 this.userId = userId;47 }48 28 49 public String getUsername() {50 return username;51 }52 29 53 public void setUsername(String username) { 30 31 public User(String username, String name, String surname, String email, String password) { 54 32 this.username = username; 55 }56 57 public String getName() {58 return name;59 }60 61 public void setName(String name) {62 33 this.name = name; 63 }64 65 public String getSurname() {66 return surname;67 }68 69 public void setSurname(String surname) {70 34 this.surname = surname; 71 }72 73 public String getEmail() {74 return email;75 }76 77 public void setEmail(String email) {78 35 this.email = email; 79 }80 81 public String getPassword() {82 return password;83 }84 85 public void setPassword(String password) {86 36 this.password = password; 87 37 } 88 38 89 @Override 90 public boolean equals(Object o) { 91 if (this == o) return true; 92 if (o == null || getClass() != o.getClass()) return false; 93 94 User that = (User) o; 95 96 if (userId != that.userId) return false; 97 if (username != null ? !username.equals(that.username) : that.username != null) return false; 98 if (name != null ? !name.equals(that.name) : that.name != null) return false; 99 if (surname != null ? !surname.equals(that.surname) : that.surname != null) return false; 100 if (email != null ? !email.equals(that.email) : that.email != null) return false; 101 if (password != null ? !password.equals(that.password) : that.password != null) return false; 102 103 return true; 104 } 105 106 @Override 107 public int hashCode() { 108 int result = userId; 109 result = 31 * result + (username != null ? username.hashCode() : 0); 110 result = 31 * result + (name != null ? name.hashCode() : 0); 111 result = 31 * result + (surname != null ? surname.hashCode() : 0); 112 result = 31 * result + (email != null ? email.hashCode() : 0); 113 result = 31 * result + (password != null ? password.hashCode() : 0); 114 return result; 115 } 116 117 public Collection<Discussion> getDiscussionsByUserId() { 118 return discussionsByUserId; 119 } 120 121 public void setDiscussionsByUserId(Collection<Discussion> discussionsByUserId) { 122 this.discussionsByUserId = discussionsByUserId; 123 } 124 125 public Collection<MovieLikesEntity> getMovieLikesByUserId() { 126 return movieLikesByUserId; 127 } 128 129 public void setMovieLikesByUserId(Collection<MovieLikesEntity> movieLikesByUserId) { 130 this.movieLikesByUserId = movieLikesByUserId; 131 } 132 133 public Collection<MovieRatesEntity> getMovieRatesByUserId() { 134 return movieRatesByUserId; 135 } 136 137 public void setMovieRatesByUserId(Collection<MovieRatesEntity> movieRatesByUserId) { 138 this.movieRatesByUserId = movieRatesByUserId; 139 } 140 141 public Collection<PersonRatesEntity> getPersonRatesByUserId() { 142 return personRatesByUserId; 143 } 144 145 public void setPersonRatesByUserId(Collection<PersonRatesEntity> personRatesByUserId) { 146 this.personRatesByUserId = personRatesByUserId; 147 } 148 149 public Collection<Reply> getRepliesByUserId() { 150 return repliesByUserId; 151 } 152 153 public void setRepliesByUserId(Collection<Reply> repliesByUserId) { 154 this.repliesByUserId = repliesByUserId; 155 } 156 157 public Collection<UserGenresEntity> getUserGenresByUserId() { 158 return userGenresByUserId; 159 } 160 161 public void setUserGenresByUserId(Collection<UserGenresEntity> userGenresByUserId) { 162 this.userGenresByUserId = userGenresByUserId; 39 public User() { 163 40 } 164 41 }
Note:
See TracChangeset
for help on using the changeset viewer.