source: src/main/java/tech/techharbor/Model/ReviewModel.java

main
Last change on this file was f4b4afa, checked in by Nikola Todoroski <nikola.todoroski@…>, 6 months ago

Pushed whole project, original project location on github:https://github.com/hehxd/Tech-Harbor

  • Property mode set to 100644
File size: 1.7 KB
Line 
1package tech.techharbor.Model;
2
3import jakarta.persistence.*;
4import lombok.Data;
5
6import java.util.Objects;
7
8@Entity
9@Data
10@Table(name = "review", schema = "project", catalog = "db_202324z_va_prj_techharbor")
11public class ReviewModel {
12 @GeneratedValue(strategy = GenerationType.IDENTITY)
13 @Id
14 @Column(name = "review_id", nullable = false)
15 private Integer reviewId;
16 @Basic
17 @Column(name = "review_rating", nullable = false)
18 private Integer reviewRating;
19 @Basic
20 @Column(name = "review_description", nullable = false, length = 100)
21 private String reviewDescription;
22 @Basic
23 @Column(name = "customer_id", nullable = false)
24 private Integer customerId;
25 @Basic
26 @Column(name = "product_id", nullable = false)
27 private Integer productId;
28
29
30 public ReviewModel(Integer reviewRating, String reviewDescription, Integer customerId, Integer productId) {
31 this.reviewRating = reviewRating;
32 this.reviewDescription = reviewDescription;
33 this.customerId = customerId;
34 this.productId = productId;
35 }
36
37 public ReviewModel() {
38 }
39
40 @Override
41 public boolean equals(Object o) {
42 if (this == o) return true;
43 if (o == null || getClass() != o.getClass()) return false;
44 ReviewModel that = (ReviewModel) o;
45 return Objects.equals(reviewId, that.reviewId) && Objects.equals(reviewRating, that.reviewRating) && Objects.equals(reviewDescription, that.reviewDescription) && Objects.equals(customerId, that.customerId) && Objects.equals(productId, that.productId);
46 }
47
48 @Override
49 public int hashCode() {
50 return Objects.hash(reviewId, reviewRating, reviewDescription, customerId, productId);
51 }
52}
Note: See TracBrowser for help on using the repository browser.