source: src/main/java/edu/gjoko/schedlr/entity/Review.java

Last change on this file was 77205be, checked in by gjoko kostadinov <gjokokostadinov@…>, 11 months ago

Add entire code

  • Property mode set to 100644
File size: 1.1 KB
Line 
1package edu.gjoko.schedlr.entity;
2
3import com.fasterxml.jackson.annotation.JsonBackReference;
4import com.fasterxml.jackson.annotation.JsonProperty;
5import lombok.AllArgsConstructor;
6import lombok.Getter;
7import lombok.NoArgsConstructor;
8import lombok.Setter;
9import org.springframework.data.annotation.LastModifiedDate;
10import org.springframework.data.jpa.domain.support.AuditingEntityListener;
11
12import javax.persistence.*;
13import java.time.LocalDateTime;
14
15@Entity
16@EntityListeners(AuditingEntityListener.class)
17@Table(name = "review")
18@Getter
19@Setter
20@NoArgsConstructor
21@AllArgsConstructor
22public class Review {
23
24 @Id
25 @GeneratedValue(strategy = GenerationType.SEQUENCE)
26 private Long id;
27
28 @Column(name = "rating")
29 private Integer rating;
30
31 @Column(name = "comment")
32 private String comment;
33
34 @OneToOne
35 @JoinColumn(name = "appointment_id", referencedColumnName = "id")
36 @JsonProperty("appointment")
37 private Appointment appointment;
38
39 @Column(name = "created")
40 @LastModifiedDate
41 private LocalDateTime created;
42
43 @Column(name = "modified")
44 @LastModifiedDate
45 private LocalDateTime modified;
46}
Note: See TracBrowser for help on using the repository browser.