[d14176d] | 1 | package project.fmo.app.projcetfmo.Model;
|
---|
[1dd9226] | 2 |
|
---|
[d14176d] | 3 | import javax.persistence.*;
|
---|
[1dd9226] | 4 |
|
---|
| 5 | import java.util.Objects;
|
---|
| 6 |
|
---|
| 7 | @Entity
|
---|
[d14176d] | 8 | @Table(schema = "project", name = "telefonskibroj", catalog = "db_202223z_va_prj_fmo")
|
---|
[1dd9226] | 9 | @IdClass(TelefonskibrojPK.class)
|
---|
| 10 | public class Telefonskibroj {
|
---|
[d14176d] | 11 |
|
---|
[1dd9226] | 12 | @Id
|
---|
| 13 | @Column(name = "id_korisnik")
|
---|
| 14 | private int idKorisnik;
|
---|
[d14176d] | 15 |
|
---|
[1dd9226] | 16 | @Id
|
---|
| 17 | @Column(name = "telefonski_broj")
|
---|
| 18 | private String telefonskiBroj;
|
---|
| 19 |
|
---|
[d14176d] | 20 | public Telefonskibroj(){}
|
---|
| 21 |
|
---|
| 22 | public Telefonskibroj(TelefonskibrojPK telefonskibrojPK) {
|
---|
| 23 | this.idKorisnik = telefonskibrojPK.getIdKorisnik();
|
---|
| 24 | this.telefonskiBroj = telefonskibrojPK.getTelefonskiBroj();
|
---|
| 25 | }
|
---|
| 26 |
|
---|
[1dd9226] | 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 | }
|
---|