source: src/main/java/com/example/moviezone/model/Category.java

Last change on this file was 00fa72f, checked in by DenicaKj <dkorvezir@…>, 21 months ago

Reservation Implemented

  • Property mode set to 100644
File size: 1.3 KB
Line 
1package com.example.moviezone.model;
2
3import lombok.Getter;
4import lombok.Setter;
5import lombok.ToString;
6import org.springframework.security.core.GrantedAuthority;
7import org.springframework.security.core.userdetails.UserDetails;
8
9import javax.management.relation.Role;
10import javax.persistence.*;
11import java.time.LocalDate;
12import java.time.LocalDateTime;
13import java.util.Collection;
14
15
16import java.util.Objects;
17
18@Getter
19@Setter
20@ToString
21@Entity
22@Table(name = "categories")
23public class Category {
24 @Id
25 @Column(name = "id_category", nullable = false)
26 @GeneratedValue(strategy = GenerationType.IDENTITY)
27 Integer idcategory;
28 String name;
29 Integer extra_amount;
30
31 public Category(String name, Integer extra_amount) {
32 this.name = name;
33 this.extra_amount = extra_amount;
34 }
35
36 public Category() {
37
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 Category that = (Category) o;
45 return Objects.equals(idcategory, that.idcategory) && Objects.equals(name, that.name) && Objects.equals(extra_amount, that.extra_amount);
46 }
47
48 @Override
49 public int hashCode() {
50 return Objects.hash(idcategory, name, extra_amount);
51 }
52}
Note: See TracBrowser for help on using the repository browser.