source: src/main/java/com/example/model/Client.java

Last change on this file was a51a591, checked in by colovik <j.colovik@…>, 14 months ago

final

  • Property mode set to 100644
File size: 1.4 KB
Line 
1package com.example.model;
2
3import com.example.model.Enumerations.Role;
4import lombok.Getter;
5import lombok.Setter;
6
7import javax.persistence.*;
8import java.util.List;
9
10@Getter
11@Setter
12@Entity
13@Table(name = "klienti")
14public class Client extends User {
15 @Column(name = "br_organizirani_nastani")
16 Integer number_events;
17
18 @OneToMany(mappedBy = "client")
19 List<Event> event;
20
21 @ManyToOne
22 @JoinColumn(name = "korisnik_id_keterinzi")
23 Catering catering_id;
24
25// @OneToMany(mappedBy = "client")
26// List<Event> events;
27
28
29 public Client(String name, String username, String number, String password, Role role) {
30 super(name, username, number, password, role);
31 this.number_events = 0;
32 }
33
34 public Client() {
35
36 }
37
38 // @Override
39// public Collection<? extends GrantedAuthority> getAuthorities() {
40// return Collections.singletonList(Role.ROLE_CLIENT);
41// }
42
43 @Override
44 public String toString() {
45 return "Client{" +
46 "number_events=" + number_events +
47 ", event=" + event.toString() +
48 ", catering_id=" + catering_id +
49 ", id=" + id +
50 ", date=" + date +
51 ", name='" + name + '\'' +
52 ", username='" + username + '\'' +
53 ", password='" + password + '\'' +
54 ", number='" + number + '\'' +
55 '}';
56 }
57}
Note: See TracBrowser for help on using the repository browser.