source: Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/User.java@ d1fe9c2

main
Last change on this file since d1fe9c2 was fdd7961, checked in by SazdovaEkaterina <sazdovaekaterina@…>, 16 months ago

fix many to one relations

  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[3d3e59d]1package finki.paw5.model.entities;
[d427a07]2
[579bf6d]3import jakarta.persistence.*;
[d427a07]4import lombok.Data;
[fdd7961]5import lombok.RequiredArgsConstructor;
[d427a07]6
[fdfc6fa]7import java.time.LocalDate;
[d427a07]8import java.util.Date;
9
10@Data
11@Entity
[fdd7961]12@RequiredArgsConstructor
[d427a07]13@Table(name = "user_table")
[579bf6d]14@Inheritance(strategy = InheritanceType.JOINED)
[d427a07]15public class User {
16
17 @Id
[038c9f7]18 @GeneratedValue(strategy = GenerationType.IDENTITY)
[d427a07]19 @Column(name = "id_user")
[ada7108]20 protected Integer id;
[d427a07]21
22 @Column(name = "date_created_user", nullable = false)
[579bf6d]23 protected LocalDate dateCreated;
[d427a07]24
25 @Column(name = "name_user", nullable = false, length = 100)
[579bf6d]26 protected String name;
[d427a07]27
[579bf6d]28 @Column(name = "email_user", nullable = false, length = 100, unique = true)
29 protected String email;
[d427a07]30
31 @Column(name = "password_user", nullable = false, length = 20)
[579bf6d]32 protected String password;
[d427a07]33
[fdfc6fa]34 @Column(name = "telephone_user", length = 20)
[579bf6d]35 protected String telephone;
[d427a07]36
[fdfc6fa]37 public User(LocalDate dateCreated, String name, String email, String password, String telephone) {
[d427a07]38 this.dateCreated = dateCreated;
39 this.name = name;
40 this.email = email;
41 this.password = password;
42 this.telephone = telephone;
43 }
44}
Note: See TracBrowser for help on using the repository browser.