From 22afe030e237649cdc08603fb284af6a74da82b7 Mon Sep 17 00:00:00 2001 From: Wo-ogie Date: Mon, 26 Feb 2024 02:05:41 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20#46=20=EC=95=85=EA=B8=B0=20=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=20entity=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../instrument/entity/InstrumentImage.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/main/java/com/ajou/hertz/domain/instrument/entity/InstrumentImage.java diff --git a/src/main/java/com/ajou/hertz/domain/instrument/entity/InstrumentImage.java b/src/main/java/com/ajou/hertz/domain/instrument/entity/InstrumentImage.java new file mode 100644 index 0000000..a90a75f --- /dev/null +++ b/src/main/java/com/ajou/hertz/domain/instrument/entity/InstrumentImage.java @@ -0,0 +1,32 @@ +package com.ajou.hertz.domain.instrument.entity; + +import com.ajou.hertz.common.entity.FileEntity; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@AllArgsConstructor(access = AccessLevel.PRIVATE) +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Getter +@Entity +public class InstrumentImage extends FileEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "instrument_image_id", nullable = false) + private Long id; + + @JoinColumn(name = "instrument_id", nullable = false) + @ManyToOne(fetch = FetchType.LAZY) + private Instrument instrument; +}