package org.example.model; import jakarta.persistence.*; import lombok.*; import org.springframework.web.bind.annotation.GetMapping; import java.io.Serializable; import java.util.UUID; @Entity @Table(name = "message_attachments") @Getter @Setter @AllArgsConstructor @NoArgsConstructor @Builder @IdClass(MessageAttachment.PK.class) public class MessageAttachment { @Id @Column(name = "message_id", nullable = false) private UUID messageId; @Column(name = "attachment_id", nullable = false) private UUID attachmentId; @Data @NoArgsConstructor @AllArgsConstructor public static class PK implements Serializable { private UUID messageId; private UUID attachmentId; } }