source: src/main/java/com/example/moviezone/model/Worker.java@ 27adfc8

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 
1package com.example.moviezone.model;
2
3import javax.persistence.*;
4import lombok.Getter;
5import lombok.Setter;
6import lombok.ToString;
7import org.springframework.security.core.GrantedAuthority;
8
9import java.time.LocalDate;
10import java.util.Collection;
11import java.util.Collections;
12
13@Entity
14@Getter
15@Setter
16@ToString
17@Table(name = "workers")
18@PrimaryKeyJoinColumn(name = "id_worker")
19public 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.