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 | |
---|
1 | package edu.gjoko.schedlr.entity;
|
---|
2 |
|
---|
3 | import com.fasterxml.jackson.annotation.JsonBackReference;
|
---|
4 | import com.fasterxml.jackson.annotation.JsonProperty;
|
---|
5 | import lombok.AllArgsConstructor;
|
---|
6 | import lombok.Getter;
|
---|
7 | import lombok.NoArgsConstructor;
|
---|
8 | import lombok.Setter;
|
---|
9 | import org.springframework.data.annotation.LastModifiedDate;
|
---|
10 | import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
---|
11 |
|
---|
12 | import javax.persistence.*;
|
---|
13 | import java.time.LocalDateTime;
|
---|
14 |
|
---|
15 | @Entity
|
---|
16 | @EntityListeners(AuditingEntityListener.class)
|
---|
17 | @Table(name = "review")
|
---|
18 | @Getter
|
---|
19 | @Setter
|
---|
20 | @NoArgsConstructor
|
---|
21 | @AllArgsConstructor
|
---|
22 | public 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.