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
RevLine 
[2e46f06]1package com.example.autopartz.model;
2
[ae042f4]3import lombok.Getter;
4import lombok.RequiredArgsConstructor;
5import lombok.Setter;
6import lombok.ToString;
[2e46f06]7import org.hibernate.Hibernate;
8
[84652fb]9import javax.persistence.*;
[2e46f06]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
[84652fb]20 @GeneratedValue(strategy = GenerationType.IDENTITY)
[4d67d70]21 @Column(name = "id_part_manufacturer")
22 Integer id;
[feffc2f]23 @Column(name = "pm_name")
24 String name;
[2e46f06]25 String pm_location;
26
[84652fb]27 public PartManufacturer(String name, String location) {
28 this.name = name;
29 this.pm_location = location;
30 }
31
[2e46f06]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;
[4d67d70]37 return id != null && Objects.equals(id, that.id);
[2e46f06]38 }
39
40 @Override
41 public int hashCode() {
42 return getClass().hashCode();
43 }
44}
Note: See TracBrowser for help on using the repository browser.