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 | |
---|
1 | package model;
|
---|
2 |
|
---|
3 | import jakarta.persistence.*;
|
---|
4 |
|
---|
5 | import java.util.Objects;
|
---|
6 |
|
---|
7 | @Entity
|
---|
8 | @IdClass(TelefonskibrojPK.class)
|
---|
9 | public 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.