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

Last change on this file since f7b0906 was 6032d44, checked in by milamihajlovska <mila.mihajlovska01@…>, 22 months ago

login method

  • Property mode set to 100644
File size: 968 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 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.