source: src/main/java/com/example/salonbella/entity/ReservationEntity.java@ 4d7e387

Last change on this file since 4d7e387 was 4d7e387, checked in by makyjovanovsky <mjovanovski04@…>, 18 months ago

commit 1

  • Property mode set to 100644
File size: 1.3 KB
Line 
1package com.example.salonbella.entity;
2
3import javax.persistence.*;
4import java.time.LocalDateTime;
5
6@Entity
7@Table(name = "reservations")
8public class ReservationEntity {
9
10 @Id
11 @GeneratedValue(strategy = GenerationType.IDENTITY)
12 private Long id;
13
14
15 @Column(name = "type", nullable = false, length = 30)
16 private String type;
17
18 @Column(name = "date_and_time", nullable = false, length = 30)
19 private LocalDateTime dateTime;
20
21 @Column(name = "valid", nullable = false)
22 private boolean valid = true;
23
24 @ManyToOne
25 @JoinColumn(name = "user_id", nullable = false)
26 private UserEntity user;
27
28
29 public ReservationEntity() {
30 }
31
32 public void setId(Long id) {
33 this.id = id;
34 }
35
36 public void setType(String type) {
37 this.type = type;
38 }
39
40 public String getType() {
41 return type;
42 }
43
44 public LocalDateTime getDateTime() {
45 return dateTime;
46 }
47
48 public void setDateTime(LocalDateTime dateTime) {
49 this.dateTime = dateTime;
50 }
51
52 public void setUser(UserEntity user) {
53 this.user = user;
54 }
55
56 public Long getId() {
57 return id;
58 }
59
60 public UserEntity getUser() {
61 return user;
62 }
63
64 public void setValid(boolean valid) {
65 this.valid = valid;
66 }
67
68 public boolean isValid() {
69 return valid;
70 }
71}
Note: See TracBrowser for help on using the repository browser.