diff --git a/src/main/java/com/ajou/hertz/domain/instrument/entity/InstrumentBrand.java b/src/main/java/com/ajou/hertz/domain/instrument/entity/InstrumentBrand.java new file mode 100644 index 0000000..4f5e182 --- /dev/null +++ b/src/main/java/com/ajou/hertz/domain/instrument/entity/InstrumentBrand.java @@ -0,0 +1,28 @@ +package com.ajou.hertz.domain.instrument.entity; + +import com.ajou.hertz.common.entity.TimeTrackedBaseEntity; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@AllArgsConstructor(access = AccessLevel.PRIVATE) +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Entity +@Table(name = "instrument_brand") +public class InstrumentBrand extends TimeTrackedBaseEntity { + + @Id + @Column(nullable = false, updatable = false) + private Long id; + + @Column(nullable = false) + private String name; + +} diff --git a/src/main/java/com/ajou/hertz/domain/instrument/entity/InstrumentModel.java b/src/main/java/com/ajou/hertz/domain/instrument/entity/InstrumentModel.java new file mode 100644 index 0000000..b0808bb --- /dev/null +++ b/src/main/java/com/ajou/hertz/domain/instrument/entity/InstrumentModel.java @@ -0,0 +1,38 @@ +package com.ajou.hertz.domain.instrument.entity; + +import com.ajou.hertz.common.entity.TimeTrackedBaseEntity; + +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 jakarta.persistence.Table; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@AllArgsConstructor(access = AccessLevel.PRIVATE) +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Entity +@Table(name = "instrument_model") +public class InstrumentModel extends TimeTrackedBaseEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(nullable = false, updatable = false) + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "instrument_brand_id", nullable = false) + private InstrumentBrand instrumentBrand; + + @Column(nullable = false) + private String name; + +}