/
ir_witch_13
/
ReadingDiaryWithRecommendationSystem
Обзор
Документация
Войти
/
ir_witch_13
/
ReadingDiaryWithRecommendationSystem
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/main/java/com/example/readingdiary/model/Quote.java
48 строк
974 B
Ira
Add entities. Set relations between them.
26 ноя 2025, 02:04
26 ноя 2025, 02:04
ff37154
Код
Авторство
О чём код?
package com.example.readingdiary.model; import jakarta.persistence.*; import java.util.UUID; @Entity public class Quote { @Id private String id; private String text; private String character; @ManyToOne @JoinColumn(name = "book_id") private final Book book; public Quote(String text, String character, Book book){ this.id = UUID.randomUUID().toString(); this.text = text; this.character = character; this.book = book; } public String getId() { return id; } public String getText() { return text; } public void setText(String text) { if(!text.isEmpty()) this.text = text; } public String getCharacter() { return character; } public void setCharacter(String character) { this.character = character; } public Book getBook() { return book; } }