main
Last change
on this file since 0226942 was c02189f, checked in by Petar Partaloski <ppartaloski@…>, 2 years ago |
Added new core functionalities, fixed bugs and improved visual clarity
|
-
Property mode
set to
100644
|
File size:
999 bytes
|
Rev | Line | |
---|
[5b447b0] | 1 | package com.wediscussmovies.project.model;
|
---|
| 2 |
|
---|
| 3 | import lombok.Data;
|
---|
| 4 |
|
---|
| 5 | import javax.persistence.*;
|
---|
| 6 | import java.util.Objects;
|
---|
| 7 |
|
---|
| 8 | @Entity
|
---|
| 9 | @Table(name = "genres", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
|
---|
| 10 | @Data
|
---|
| 11 | public class Genre {
|
---|
| 12 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
| 13 | @Id
|
---|
| 14 | @Column(name = "genre_id")
|
---|
| 15 | private int genreId;
|
---|
| 16 | @Basic
|
---|
| 17 | @Column(name = "genre_type")
|
---|
| 18 | private String genreType;
|
---|
| 19 |
|
---|
| 20 | public Genre() {
|
---|
| 21 |
|
---|
| 22 | }
|
---|
| 23 |
|
---|
[c02189f] | 24 | public Genre(int genreId, String genreType) {
|
---|
| 25 | this.genreId = genreId;
|
---|
| 26 | this.genreType = genreType;
|
---|
| 27 | }
|
---|
| 28 |
|
---|
[5b447b0] | 29 | public Genre(String genreType) {
|
---|
| 30 | this.genreType = genreType;
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | @Override
|
---|
| 34 | public boolean equals(Object o) {
|
---|
| 35 | if (this == o) return true;
|
---|
| 36 | if (o == null || getClass() != o.getClass()) return false;
|
---|
| 37 | Genre genre = (Genre) o;
|
---|
| 38 | return genreId == genre.genreId;
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | @Override
|
---|
| 42 | public int hashCode() {
|
---|
| 43 | return Objects.hash(genreId);
|
---|
| 44 | }
|
---|
| 45 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.