source: src/main/java/project/fmo/app/projcetfmo/Model/Telefonskibroj.java@ 1dd9226

main
Last change on this file since 1dd9226 was 1dd9226, checked in by HristijanMitic00 <hristijan.mitic.01@…>, 17 months ago

Initial commit

  • Property mode set to 100644
File size: 1.2 KB
Line 
1package model;
2
3import jakarta.persistence.*;
4
5import java.util.Objects;
6
7@Entity
8@IdClass(TelefonskibrojPK.class)
9public class Telefonskibroj {
10 @GeneratedValue(strategy = GenerationType.IDENTITY)
11 @Id
12 @Column(name = "id_korisnik")
13 private int idKorisnik;
14 @GeneratedValue(strategy = GenerationType.IDENTITY)
15 @Id
16 @Column(name = "telefonski_broj")
17 private String telefonskiBroj;
18
19 public int getIdKorisnik() {
20 return idKorisnik;
21 }
22
23 public void setIdKorisnik(int idKorisnik) {
24 this.idKorisnik = idKorisnik;
25 }
26
27 public String getTelefonskiBroj() {
28 return telefonskiBroj;
29 }
30
31 public void setTelefonskiBroj(String telefonskiBroj) {
32 this.telefonskiBroj = telefonskiBroj;
33 }
34
35 @Override
36 public boolean equals(Object o) {
37 if (this == o) return true;
38 if (o == null || getClass() != o.getClass()) return false;
39 Telefonskibroj that = (Telefonskibroj) o;
40 return idKorisnik == that.idKorisnik && Objects.equals(telefonskiBroj, that.telefonskiBroj);
41 }
42
43 @Override
44 public int hashCode() {
45 return Objects.hash(idKorisnik, telefonskiBroj);
46 }
47}
Note: See TracBrowser for help on using the repository browser.