main
Last change
on this file since 7f36551 was 5b447b0, checked in by Test <matonikolov77@…>, 2 years ago |
Adding models and resources
|
-
Property mode
set to
100644
|
File size:
874 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 |
|
---|
| 24 | public Genre(String genreType) {
|
---|
| 25 | this.genreType = genreType;
|
---|
| 26 | }
|
---|
| 27 |
|
---|
| 28 | @Override
|
---|
| 29 | public boolean equals(Object o) {
|
---|
| 30 | if (this == o) return true;
|
---|
| 31 | if (o == null || getClass() != o.getClass()) return false;
|
---|
| 32 | Genre genre = (Genre) o;
|
---|
| 33 | return genreId == genre.genreId;
|
---|
| 34 | }
|
---|
| 35 |
|
---|
| 36 | @Override
|
---|
| 37 | public int hashCode() {
|
---|
| 38 | return Objects.hash(genreId);
|
---|
| 39 | }
|
---|
| 40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.