Last change
on this file since 27adfc8 was 27adfc8, checked in by milamihajlovska <mila.mihajlovska01@…>, 22 months ago |
register method
|
-
Property mode
set to
100644
|
File size:
944 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 | @Override
|
---|
35 | public Collection<? extends GrantedAuthority> getAuthorities() {
|
---|
36 | return Collections.singletonList(Role.ROLE_ADMIN);
|
---|
37 | }
|
---|
38 |
|
---|
39 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.