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

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

First commit

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