Last change
on this file since 45e9a02 was 6032d44, checked in by milamihajlovska <mila.mihajlovska01@…>, 22 months ago |
login method
|
-
Property mode
set to
100644
|
File size:
968 bytes
|
Line | |
---|
1 | package com.example.moviezone.model;
|
---|
2 |
|
---|
3 | import javax.persistence.*;
|
---|
4 | import lombok.Getter;
|
---|
5 | import lombok.Setter;
|
---|
6 | import lombok.ToString;
|
---|
7 | import org.springframework.security.core.GrantedAuthority;
|
---|
8 |
|
---|
9 | import java.time.LocalDate;
|
---|
10 | import java.util.Collection;
|
---|
11 | import java.util.Collections;
|
---|
12 |
|
---|
13 | @Entity
|
---|
14 | @Getter
|
---|
15 | @Setter
|
---|
16 | @ToString
|
---|
17 | @Table(name = "workers")
|
---|
18 | @PrimaryKeyJoinColumn(name = "id_worker")
|
---|
19 | public class Worker extends User {
|
---|
20 |
|
---|
21 | String position;
|
---|
22 |
|
---|
23 | String work_hours_from;
|
---|
24 | String work_hours_to;
|
---|
25 |
|
---|
26 | @ManyToOne
|
---|
27 | @JoinColumn(name = "id_cinema")
|
---|
28 | Cinema cinema;
|
---|
29 |
|
---|
30 | public Worker(String password, String first_name, String last_name, String address, String contact_number, String username) {
|
---|
31 | super(password, first_name, last_name, address, contact_number, username);
|
---|
32 | }
|
---|
33 |
|
---|
34 | public Worker() {
|
---|
35 |
|
---|
36 | }
|
---|
37 |
|
---|
38 | @Override
|
---|
39 | public Collection<? extends GrantedAuthority> getAuthorities() {
|
---|
40 | return Collections.singletonList(Role.ROLE_ADMIN);
|
---|
41 | }
|
---|
42 |
|
---|
43 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.