package ru.mtuci.messenger.domain; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.Id; import jakarta.persistence.Table; import java.util.UUID; @Entity @Table(name = "attachment_variants") public class AttachmentVariantEntity { @Id private UUID id; @Column(name = "attachment_id", nullable = false) private UUID attachmentId; @Column(name = "pipeline_version", nullable = false) private int pipelineVersion; @Column(nullable = false, length = 16) private String name; @Column(name = "content_type", nullable = false, length = 32) private String contentType; @Column(name = "size_bytes", nullable = false) private long sizeBytes; @Column(nullable = false) private int width; @Column(nullable = false) private int height; @Column(nullable = false, length = 64) private String sha256; @Column(name = "object_key", nullable = false, length = 120) private String objectKey; protected AttachmentVariantEntity() { } public AttachmentVariantEntity(UUID id, UUID attachmentId, int pipelineVersion, String name, String contentType, long sizeBytes, int width, int height, String sha256, String objectKey) { this.id = id; this.attachmentId = attachmentId; this.pipelineVersion = pipelineVersion; this.name = name; this.contentType = contentType; this.sizeBytes = sizeBytes; this.width = width; this.height = height; this.sha256 = sha256; this.objectKey = objectKey; } public UUID getId() { return id; } public UUID getAttachmentId() { return attachmentId; } public int getPipelineVersion() { return pipelineVersion; } public String getName() { return name; } public String getContentType() { return contentType; } public long getSizeBytes() { return sizeBytes; } public int getWidth() { return width; } public int getHeight() { return height; } public String getSha256() { return sha256; } public String getObjectKey() { return objectKey; } }