Skip to content

Commit

Permalink
Merge pull request #43 from Ajou-Hertz/feature/#37-brand-model-entity
Browse files Browse the repository at this point in the history
악기 브랜드,모델 엔티티 생성
  • Loading branch information
Wo-ogie authored Feb 23, 2024
2 parents 73d4d3a + a34895b commit dff2e5b
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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;

}
Original file line number Diff line number Diff line change
@@ -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;

}

0 comments on commit dff2e5b

Please sign in to comment.