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