source: src/main/java/com/example/autopartz/model/PartManufacturer.java@ 84652fb

main
Last change on this file since 84652fb was 84652fb, checked in by andrejtodorovski <82031894+andrejtodorovski@…>, 18 months ago

Admin views for adding things to the database

  • Property mode set to 100644
File size: 1.0 KB
Line 
1package com.example.autopartz.model;
2
3import lombok.Getter;
4import lombok.RequiredArgsConstructor;
5import lombok.Setter;
6import lombok.ToString;
7import org.hibernate.Hibernate;
8
9import javax.persistence.*;
10import java.util.Objects;
11
12@Getter
13@Setter
14@ToString
15@RequiredArgsConstructor
16@Entity
17@Table(name = "part_manufacturer")
18public class PartManufacturer {
19 @Id
20 @GeneratedValue(strategy = GenerationType.IDENTITY)
21 @Column(name = "id_part_manufacturer")
22 Integer id;
23 @Column(name = "pm_name")
24 String name;
25 String pm_location;
26
27 public PartManufacturer(String name, String location) {
28 this.name = name;
29 this.pm_location = location;
30 }
31
32 @Override
33 public boolean equals(Object o) {
34 if (this == o) return true;
35 if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
36 PartManufacturer that = (PartManufacturer) o;
37 return id != null && Objects.equals(id, that.id);
38 }
39
40 @Override
41 public int hashCode() {
42 return getClass().hashCode();
43 }
44}
Note: See TracBrowser for help on using the repository browser.