1 | package finki.paw5.model.entities;
|
---|
2 |
|
---|
3 | import jakarta.persistence.*;
|
---|
4 | import lombok.Data;
|
---|
5 |
|
---|
6 | import java.time.LocalDate;
|
---|
7 | import java.util.Date;
|
---|
8 |
|
---|
9 | @Data
|
---|
10 | @Entity
|
---|
11 | @Table(name = "user_table")
|
---|
12 | @Inheritance(strategy = InheritanceType.JOINED)
|
---|
13 | public class User {
|
---|
14 |
|
---|
15 | @Id
|
---|
16 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
17 | @Column(name = "id_user")
|
---|
18 | protected Integer id;
|
---|
19 |
|
---|
20 | @Column(name = "date_created_user", nullable = false)
|
---|
21 | protected LocalDate dateCreated;
|
---|
22 |
|
---|
23 | @Column(name = "name_user", nullable = false, length = 100)
|
---|
24 | protected String name;
|
---|
25 |
|
---|
26 | @Column(name = "email_user", nullable = false, length = 100, unique = true)
|
---|
27 | protected String email;
|
---|
28 |
|
---|
29 | @Column(name = "password_user", nullable = false, length = 20)
|
---|
30 | protected String password;
|
---|
31 |
|
---|
32 | @Column(name = "telephone_user", length = 20)
|
---|
33 | protected String telephone;
|
---|
34 |
|
---|
35 | public User(LocalDate dateCreated, String name, String email, String password, String telephone) {
|
---|
36 | this.dateCreated = dateCreated;
|
---|
37 | this.name = name;
|
---|
38 | this.email = email;
|
---|
39 | this.password = password;
|
---|
40 | this.telephone = telephone;
|
---|
41 | }
|
---|
42 |
|
---|
43 | public User() {
|
---|
44 | }
|
---|
45 | }
|
---|