main
|
Last change
on this file since 700e2f9 was 700e2f9, checked in by 186079 <matej.milevski@…>, 5 days ago |
|
Init
|
-
Property mode
set to
100644
|
|
File size:
853 bytes
|
| Line | |
|---|
| 1 | package com.finki.icare.model;
|
|---|
| 2 |
|
|---|
| 3 | import jakarta.persistence.*;
|
|---|
| 4 | import lombok.AllArgsConstructor;
|
|---|
| 5 | import lombok.Data;
|
|---|
| 6 | import lombok.NoArgsConstructor;
|
|---|
| 7 |
|
|---|
| 8 | import java.time.LocalDate;
|
|---|
| 9 |
|
|---|
| 10 | @Entity
|
|---|
| 11 | @Table(
|
|---|
| 12 | name = "diary",
|
|---|
| 13 | uniqueConstraints = @UniqueConstraint(columnNames = {"id_patient", "date"})
|
|---|
| 14 | )
|
|---|
| 15 | @Data
|
|---|
| 16 | @NoArgsConstructor
|
|---|
| 17 | @AllArgsConstructor
|
|---|
| 18 | public class Diary {
|
|---|
| 19 |
|
|---|
| 20 | @Id
|
|---|
| 21 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
|---|
| 22 | @Column(name = "id_diary")
|
|---|
| 23 | private Integer idDiary;
|
|---|
| 24 |
|
|---|
| 25 | @ManyToOne
|
|---|
| 26 | @JoinColumn(name = "id_patient", nullable = false)
|
|---|
| 27 | private Patient patient;
|
|---|
| 28 |
|
|---|
| 29 | @Column(name = "date", nullable = false)
|
|---|
| 30 | private LocalDate date;
|
|---|
| 31 |
|
|---|
| 32 | @Column(name = "daily_rating", nullable = false)
|
|---|
| 33 | private Short dailyRating;
|
|---|
| 34 |
|
|---|
| 35 | @Column(name = "content", nullable = false, columnDefinition = "TEXT")
|
|---|
| 36 | private String content;
|
|---|
| 37 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.