1 | package com.proekt.model;
|
---|
2 |
|
---|
3 |
|
---|
4 | import com.proekt.model.Korisnik.Korisnik;
|
---|
5 | import lombok.Data;
|
---|
6 |
|
---|
7 | import javax.persistence.*;
|
---|
8 | import javax.persistence.ManyToOne;
|
---|
9 |
|
---|
10 | @Data
|
---|
11 | @Table
|
---|
12 | @Entity
|
---|
13 |
|
---|
14 | public class Avtomobil {
|
---|
15 |
|
---|
16 | @Id
|
---|
17 | @Column(name="reg_tablica")
|
---|
18 | private String regTablica;
|
---|
19 |
|
---|
20 | @Column(nullable = false,length = 20,unique = true)
|
---|
21 | private String marka;
|
---|
22 |
|
---|
23 | @Column(nullable = false,length = 15,unique = true)
|
---|
24 | private String boja;
|
---|
25 |
|
---|
26 |
|
---|
27 |
|
---|
28 | @ManyToOne
|
---|
29 | @JoinColumn(name="korisnickoime")
|
---|
30 | public Korisnik korisnickoIme;
|
---|
31 |
|
---|
32 | public Avtomobil(String regTablica, String marka, String boja, Korisnik korisnik) {
|
---|
33 | this.regTablica = regTablica;
|
---|
34 | this.korisnickoIme = korisnik;
|
---|
35 | this.marka = marka;
|
---|
36 | this.boja = boja;
|
---|
37 | }
|
---|
38 |
|
---|
39 | public Avtomobil() {
|
---|
40 | }
|
---|
41 |
|
---|
42 | public String getRegTablica() {
|
---|
43 | return regTablica;
|
---|
44 | }
|
---|
45 |
|
---|
46 | public void setRegTablica(String regTablica) {
|
---|
47 | this.regTablica = regTablica;
|
---|
48 | }
|
---|
49 |
|
---|
50 | public String getMarka() {
|
---|
51 | return marka;
|
---|
52 | }
|
---|
53 |
|
---|
54 | public void setMarka(String marka) {
|
---|
55 | this.marka = marka;
|
---|
56 | }
|
---|
57 |
|
---|
58 | public String getBoja() {
|
---|
59 | return boja;
|
---|
60 | }
|
---|
61 |
|
---|
62 | public void setBoja(String boja) {
|
---|
63 | this.boja = boja;
|
---|
64 | }
|
---|
65 |
|
---|
66 | public Korisnik getKorisnickoIme() {
|
---|
67 | return korisnickoIme;
|
---|
68 | }
|
---|
69 |
|
---|
70 | public void setKorisnickoIme(Korisnik korisnickoIme) {
|
---|
71 | this.korisnickoIme = korisnickoIme;
|
---|
72 | }
|
---|
73 | } |
---|