[ed20c2c] | 1 | package com.example.baza.model;
|
---|
| 2 | //
|
---|
| 3 | //import javax.persistence.*;
|
---|
| 4 | //
|
---|
| 5 | //@Entity
|
---|
| 6 | //@Table(name = "chovek", schema = "project")
|
---|
| 7 | //public class Chovek2 {
|
---|
| 8 | // @Id
|
---|
| 9 | // @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
| 10 | // @Column(name = "id_chovek", nullable = false)
|
---|
| 11 | // private Integer id;
|
---|
| 12 | //
|
---|
| 13 | // @Column(name = "ime", nullable = false, length = 50)
|
---|
| 14 | // private String ime;
|
---|
| 15 | //
|
---|
| 16 | // @Column(name = "prezime", nullable = false, length = 50)
|
---|
| 17 | // private String prezime;
|
---|
| 18 | //
|
---|
| 19 | // @Column(name = "email", nullable = false, length = 50)
|
---|
| 20 | // private String email;
|
---|
| 21 | //
|
---|
| 22 | // @Column(name = "tel_broj", nullable = false, length = 25)
|
---|
| 23 | // private String telBroj;
|
---|
| 24 | //
|
---|
| 25 | // @Column(name = "adresa", nullable = false, length = 150)
|
---|
| 26 | // private String adresa;
|
---|
| 27 | //
|
---|
| 28 | // @Column(name = "embg", nullable = false, length = 13)
|
---|
| 29 | // private String embg;
|
---|
| 30 | //
|
---|
| 31 | // @Column(name = "username", nullable = false, length = 50)
|
---|
| 32 | // private String username;
|
---|
| 33 | //
|
---|
| 34 | // @Column(name = "password", nullable = false, length = 100)
|
---|
| 35 | // private String password;
|
---|
| 36 | //
|
---|
| 37 | // public String getPassword() {
|
---|
| 38 | // return password;
|
---|
| 39 | // }
|
---|
| 40 | //
|
---|
| 41 | // public void setPassword(String password) {
|
---|
| 42 | // this.password = password;
|
---|
| 43 | // }
|
---|
| 44 | //
|
---|
| 45 | // public String getUsername() {
|
---|
| 46 | // return username;
|
---|
| 47 | // }
|
---|
| 48 | //
|
---|
| 49 | // public void setUsername(String username) {
|
---|
| 50 | // this.username = username;
|
---|
| 51 | // }
|
---|
| 52 | //
|
---|
| 53 | // public String getEmbg() {
|
---|
| 54 | // return embg;
|
---|
| 55 | // }
|
---|
| 56 | //
|
---|
| 57 | // public void setEmbg(String embg) {
|
---|
| 58 | // this.embg = embg;
|
---|
| 59 | // }
|
---|
| 60 | //
|
---|
| 61 | // public String getAdresa() {
|
---|
| 62 | // return adresa;
|
---|
| 63 | // }
|
---|
| 64 | //
|
---|
| 65 | // public void setAdresa(String adresa) {
|
---|
| 66 | // this.adresa = adresa;
|
---|
| 67 | // }
|
---|
| 68 | //
|
---|
| 69 | // public String getTelBroj() {
|
---|
| 70 | // return telBroj;
|
---|
| 71 | // }
|
---|
| 72 | //
|
---|
| 73 | // public void setTelBroj(String telBroj) {
|
---|
| 74 | // this.telBroj = telBroj;
|
---|
| 75 | // }
|
---|
| 76 | //
|
---|
| 77 | // public String getEmail() {
|
---|
| 78 | // return email;
|
---|
| 79 | // }
|
---|
| 80 | //
|
---|
| 81 | // public void setEmail(String email) {
|
---|
| 82 | // this.email = email;
|
---|
| 83 | // }
|
---|
| 84 | //
|
---|
| 85 | // public String getPrezime() {
|
---|
| 86 | // return prezime;
|
---|
| 87 | // }
|
---|
| 88 | //
|
---|
| 89 | // public void setPrezime(String prezime) {
|
---|
| 90 | // this.prezime = prezime;
|
---|
| 91 | // }
|
---|
| 92 | //
|
---|
| 93 | // public String getIme() {
|
---|
| 94 | // return ime;
|
---|
| 95 | // }
|
---|
| 96 | //
|
---|
| 97 | // public void setIme(String ime) {
|
---|
| 98 | // this.ime = ime;
|
---|
| 99 | // }
|
---|
| 100 | //
|
---|
| 101 | // public Integer getId() {
|
---|
| 102 | // return id;
|
---|
| 103 | // }
|
---|
| 104 | //
|
---|
| 105 | // public void setId(Integer id) {
|
---|
| 106 | // this.id = id;
|
---|
| 107 | // }
|
---|
| 108 | //}
|
---|
| 109 |
|
---|
| 110 |
|
---|
| 111 | import com.example.baza.model.Authentication;
|
---|
| 112 | import com.example.baza.model.Bibliotekar2;
|
---|
| 113 | import com.example.baza.model.Chlen2;
|
---|
| 114 |
|
---|
| 115 | import javax.persistence.*;
|
---|
| 116 | import java.util.LinkedHashSet;
|
---|
| 117 | import java.util.Set;
|
---|
| 118 |
|
---|
| 119 | @Entity
|
---|
| 120 | @Table(name = "chovek", schema = "project")
|
---|
| 121 | public class Chovek2 {
|
---|
| 122 | @Id
|
---|
| 123 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
| 124 | @Column(name = "id_chovek", nullable = false)
|
---|
| 125 | private Integer id;
|
---|
| 126 |
|
---|
| 127 | @Column(name = "ime", nullable = false, length = 50)
|
---|
| 128 | private String ime;
|
---|
| 129 |
|
---|
| 130 | @Column(name = "prezime", nullable = false, length = 50)
|
---|
| 131 | private String prezime;
|
---|
| 132 |
|
---|
| 133 | @Column(name = "email", nullable = false, length = 50)
|
---|
| 134 | private String email;
|
---|
| 135 |
|
---|
| 136 | @Column(name = "tel_broj", nullable = false, length = 25)
|
---|
| 137 | private String telBroj;
|
---|
| 138 |
|
---|
| 139 | @Column(name = "adresa", nullable = false, length = 150)
|
---|
| 140 | private String adresa;
|
---|
| 141 |
|
---|
| 142 | @Column(name = "embg",columnDefinition = "bpchar(13)", nullable = false, length = 13)
|
---|
| 143 | private String embg;
|
---|
| 144 |
|
---|
| 145 | @Column(name = "username", nullable = false, length = 50)
|
---|
| 146 | private String username;
|
---|
| 147 |
|
---|
| 148 | @Column(name = "password", nullable = false, length = 100)
|
---|
| 149 | private String password;
|
---|
| 150 |
|
---|
| 151 | @OneToOne(fetch = FetchType.LAZY, mappedBy = "chovek")
|
---|
| 152 | private Chlen2 chlen;
|
---|
| 153 |
|
---|
| 154 | @OneToOne(fetch = FetchType.LAZY, mappedBy = "chovek")
|
---|
| 155 | private Bibliotekar2 bibliotekar;
|
---|
| 156 |
|
---|
| 157 | @OneToMany(mappedBy = "chovek")
|
---|
| 158 | private Set<Authentication> authentications = new LinkedHashSet<>();
|
---|
| 159 |
|
---|
| 160 | public Set<Authentication> getAuthentications() {
|
---|
| 161 | return authentications;
|
---|
| 162 | }
|
---|
| 163 |
|
---|
| 164 | public void setAuthentications(Set<Authentication> authentications) {
|
---|
| 165 | this.authentications = authentications;
|
---|
| 166 | }
|
---|
| 167 |
|
---|
| 168 | public Bibliotekar2 getBibliotekar() {
|
---|
| 169 | return bibliotekar;
|
---|
| 170 | }
|
---|
| 171 |
|
---|
| 172 | public void setBibliotekar(Bibliotekar2 bibliotekar) {
|
---|
| 173 | this.bibliotekar = bibliotekar;
|
---|
| 174 | }
|
---|
| 175 |
|
---|
| 176 | public Chlen2 getChlen() {
|
---|
| 177 | return chlen;
|
---|
| 178 | }
|
---|
| 179 |
|
---|
| 180 | public void setChlen(Chlen2 chlen) {
|
---|
| 181 | this.chlen = chlen;
|
---|
| 182 | }
|
---|
| 183 |
|
---|
| 184 | public Chovek2(String ime, String prezime, String email, String telBroj, String adresa, String embg, String username, String password) {
|
---|
| 185 | this.ime = ime;
|
---|
| 186 | this.prezime = prezime;
|
---|
| 187 | this.email = email;
|
---|
| 188 | this.telBroj = telBroj;
|
---|
| 189 | this.adresa = adresa;
|
---|
| 190 | this.embg = embg;
|
---|
| 191 | this.username = username;
|
---|
| 192 | this.password = password;
|
---|
| 193 | }
|
---|
| 194 |
|
---|
| 195 | public Chovek2() {
|
---|
| 196 |
|
---|
| 197 | }
|
---|
| 198 |
|
---|
| 199 | public String getPassword() {
|
---|
| 200 | return password;
|
---|
| 201 | }
|
---|
| 202 |
|
---|
| 203 | public void setPassword(String password) {
|
---|
| 204 | this.password = password;
|
---|
| 205 | }
|
---|
| 206 |
|
---|
| 207 | public String getUsername() {
|
---|
| 208 | return username;
|
---|
| 209 | }
|
---|
| 210 |
|
---|
| 211 | public void setUsername(String username) {
|
---|
| 212 | this.username = username;
|
---|
| 213 | }
|
---|
| 214 |
|
---|
| 215 | public String getEmbg() {
|
---|
| 216 | return embg;
|
---|
| 217 | }
|
---|
| 218 |
|
---|
| 219 | public void setEmbg(String embg) {
|
---|
| 220 | this.embg = embg;
|
---|
| 221 | }
|
---|
| 222 |
|
---|
| 223 | public String getAdresa() {
|
---|
| 224 | return adresa;
|
---|
| 225 | }
|
---|
| 226 |
|
---|
| 227 | public void setAdresa(String adresa) {
|
---|
| 228 | this.adresa = adresa;
|
---|
| 229 | }
|
---|
| 230 |
|
---|
| 231 | public String getTelBroj() {
|
---|
| 232 | return telBroj;
|
---|
| 233 | }
|
---|
| 234 |
|
---|
| 235 | public void setTelBroj(String telBroj) {
|
---|
| 236 | this.telBroj = telBroj;
|
---|
| 237 | }
|
---|
| 238 |
|
---|
| 239 | public String getEmail() {
|
---|
| 240 | return email;
|
---|
| 241 | }
|
---|
| 242 |
|
---|
| 243 | public void setEmail(String email) {
|
---|
| 244 | this.email = email;
|
---|
| 245 | }
|
---|
| 246 |
|
---|
| 247 | public String getPrezime() {
|
---|
| 248 | return prezime;
|
---|
| 249 | }
|
---|
| 250 |
|
---|
| 251 | public void setPrezime(String prezime) {
|
---|
| 252 | this.prezime = prezime;
|
---|
| 253 | }
|
---|
| 254 |
|
---|
| 255 | public String getIme() {
|
---|
| 256 | return ime;
|
---|
| 257 | }
|
---|
| 258 |
|
---|
| 259 | public void setIme(String ime) {
|
---|
| 260 | this.ime = ime;
|
---|
| 261 | }
|
---|
| 262 |
|
---|
| 263 | public Integer getId() {
|
---|
| 264 | return id;
|
---|
| 265 | }
|
---|
| 266 |
|
---|
| 267 | public void setId(Integer id) {
|
---|
| 268 | this.id = id;
|
---|
| 269 | }
|
---|
| 270 | } |
---|