main
Last change
on this file since fdfc6fa was fdfc6fa, checked in by SazdovaEkaterina <sazdovaekaterina@…>, 17 months ago |
change to LocalDate
Date (Java) was incompatible with date (postgresql) because it expected a timestamp type, not date
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[d427a07] | 1 | package finki.paw5.model;
|
---|
| 2 |
|
---|
| 3 | import jakarta.persistence.Column;
|
---|
| 4 | import jakarta.persistence.Entity;
|
---|
| 5 | import jakarta.persistence.Id;
|
---|
| 6 | import jakarta.persistence.Table;
|
---|
| 7 | import lombok.Data;
|
---|
| 8 |
|
---|
[fdfc6fa] | 9 | import java.time.LocalDate;
|
---|
[d427a07] | 10 | import java.util.Date;
|
---|
| 11 |
|
---|
| 12 | @Data
|
---|
| 13 | @Entity
|
---|
| 14 | @Table(name = "user_table")
|
---|
| 15 | public class User {
|
---|
| 16 |
|
---|
| 17 | @Id
|
---|
| 18 | @Column(name = "id_user")
|
---|
| 19 | private int id;
|
---|
| 20 |
|
---|
| 21 | @Column(name = "date_created_user", nullable = false)
|
---|
[fdfc6fa] | 22 | private LocalDate dateCreated;
|
---|
[d427a07] | 23 |
|
---|
| 24 | @Column(name = "name_user", nullable = false, length = 100)
|
---|
| 25 | private String name;
|
---|
| 26 |
|
---|
| 27 | @Column(name = "email_user", nullable = false, length = 100, unique=true)
|
---|
| 28 | private String email;
|
---|
| 29 |
|
---|
| 30 | @Column(name = "password_user", nullable = false, length = 20)
|
---|
| 31 | private String password;
|
---|
| 32 |
|
---|
[fdfc6fa] | 33 | @Column(name = "telephone_user", length = 20)
|
---|
[d427a07] | 34 | private String telephone;
|
---|
| 35 |
|
---|
[fdfc6fa] | 36 | public User(LocalDate dateCreated, String name, String email, String password, String telephone) {
|
---|
[d427a07] | 37 | this.dateCreated = dateCreated;
|
---|
| 38 | this.name = name;
|
---|
| 39 | this.email = email;
|
---|
| 40 | this.password = password;
|
---|
| 41 | this.telephone = telephone;
|
---|
| 42 | }
|
---|
| 43 |
|
---|
| 44 | public User() {
|
---|
| 45 | }
|
---|
| 46 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.