source: src/main/java/com/example/moviezone/model/User.java@ eb226b2

Last change on this file since eb226b2 was eb226b2, checked in by DenicaKj <dkorvezir@…>, 22 months ago

Fixing errors

  • Property mode set to 100644
File size: 1.7 KB
Line 
1package com.example.moviezone.model;
2
3import jakarta.persistence.*;
4import lombok.Getter;
5import lombok.Setter;
6import lombok.ToString;
7import org.springframework.security.core.GrantedAuthority;
8import org.springframework.security.core.userdetails.UserDetails;
9
10import javax.management.relation.Role;
11import java.time.LocalDate;
12import java.time.LocalDateTime;
13import java.util.Collection;
14
15@Entity
16@Getter
17@Setter
18@ToString
19@Table(name = "users")
20@Inheritance(strategy = InheritanceType.JOINED)
21public class User implements UserDetails {
22
23 @Id
24 @GeneratedValue(strategy = GenerationType.IDENTITY)
25 Integer id_user;
26 String password;
27 String first_name;
28 String last_name;
29 String address;
30 String contact_number;
31 String username;
32 LocalDate date_created;
33
34
35 public User(Integer id_user, String password, String first_name, String last_name, String address, String contact_number, String username, LocalDate date_created) {
36 this.id_user = id_user;
37 this.password = password;
38 this.first_name = first_name;
39 this.last_name = last_name;
40 this.address = address;
41 this.contact_number = contact_number;
42 this.username = username;
43 this.date_created = date_created;
44 }
45
46 public User() {
47
48 }
49
50 @Override
51 public Collection<? extends GrantedAuthority> getAuthorities() {
52 return null;
53 }
54
55
56 @Override
57 public boolean isAccountNonExpired() {
58 return true;
59 }
60
61 @Override
62 public boolean isAccountNonLocked() {
63 return true;
64 }
65
66 @Override
67 public boolean isCredentialsNonExpired() {
68 return true;
69 }
70
71 @Override
72 public boolean isEnabled() {
73 return true;
74 }
75
76}
Note: See TracBrowser for help on using the repository browser.