Changeset 6626008 for src/main


Ignore:
Timestamp:
02/02/23 15:09:53 (22 months ago)
Author:
milamihajlovska <mila.mihajlovska01@…>
Branches:
master
Children:
d12020e
Parents:
e6b2246 (diff), d522b3f (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.
Message:

Merge branch 'master' of https://github.com/DenicaKj/MovieZone

Location:
src/main/java/com/example/moviezone/model
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/moviezone/model/Categories.java

    re6b2246 r6626008  
    11package com.example.moviezone.model;
    22
    3 import jakarta.persistence.Entity;
     3import jakarta.persistence.*;
    44import lombok.Getter;
    55import lombok.Setter;
    66import lombok.ToString;
     7
     8import java.util.Objects;
    79
    810@Getter
     
    1113@Entity
    1214public class Categories {
     15    @Id
     16    @Column(name = "id_category", nullable = false)
     17    @GeneratedValue(strategy = GenerationType.IDENTITY)
     18    private Long id_category;
     19    String name;
     20    Integer extra_amount;
     21
     22    public Categories(String name, Integer extra_amount) {
     23        this.name = name;
     24        this.extra_amount = extra_amount;
     25    }
     26
     27    public Categories() {
     28
     29    }
     30
     31    @Override
     32    public boolean equals(Object o) {
     33        if (this == o) return true;
     34        if (o == null || getClass() != o.getClass()) return false;
     35        Categories that = (Categories) o;
     36        return Objects.equals(id_category, that.id_category) && Objects.equals(name, that.name) && Objects.equals(extra_amount, that.extra_amount);
     37    }
     38
     39    @Override
     40    public int hashCode() {
     41        return Objects.hash(id_category, name, extra_amount);
     42    }
    1343}
Note: See TracChangeset for help on using the changeset viewer.