/
NikolayVasiljev
/
Project
Обзор
Документация
Войти
/
NikolayVasiljev
/
Project
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
feature
src/main/java/org/example/notesystem/model/Note.java
95 строк
2 KB
VasiljevNik
My sixth commit
07 авг 2025, 13:30
07 авг 2025, 13:30
7369756
Код
Авторство
О чём код?
package org.example.notesystem.model; import jakarta.persistence.*; import lombok.Data; @Entity @Data public class Note { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String title; private String content; private String authorUsername; @Lob private byte[] attachedFile; private String fileName; @ManyToOne private User user; public Note() {} public Note(Long id, String content, String authorUsername) { this.id = id; this.content = content; this.authorUsername = authorUsername; } public Note(Long id, String content, String authorUsername, byte[] attachedFile,String fileName){ this.id = id; this.content = content; this.authorUsername = authorUsername; this.attachedFile=attachedFile; this.fileName=fileName; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getAuthorUsername() { return authorUsername; } public void setAuthorUsername(String authorUsername) { this.authorUsername = authorUsername; } public User getUser() { return user; } public void setUser(User user) { this.user = user; } public byte[] getAttachedFile() { return attachedFile; } public void setAttachedFile(byte[] attachedFile) { this.attachedFile = attachedFile; } public String getFileName() { return fileName; } public void setFileName(String fileName) { this.fileName = fileName; } }