Skip to content

Commit

Permalink
[feat] 모델, 모델소개, 및 하위 3개 테이블 엔티티 작성 (#15)
Browse files Browse the repository at this point in the history
* feat : #11 Model 도메인 생성

* feat : #11-모델소개 테이블 및 하위 테이블 3개 엔티티 생성

* feat :#11-model 테이블 컬럼 추가

* fix : manyToOne 지연로딩 설정, 기본키 컬럼명 id로 통일

* feat : #11 - model 테이블 ai점수 컬럼 추가

* feat : #11 nullable 속성 일괄 적용

* fix #11 : Column -> joinColumn 매핑 오류 수정
  • Loading branch information
j2noo authored Mar 4, 2024
1 parent 8a08a30 commit 41477d0
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/main/java/com/backend/soullive_a/entity/Model.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.backend.soullive_a.entity;

import jakarta.persistence.*;
import lombok.*;

import java.time.LocalDateTime;

@Entity
@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Model {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "MODEL_ID", nullable = false)
private Long id;

@Column(name = "MODEL_NAME", nullable = false)
private String modelName;

@Column(name = "BIRTH", nullable = false)
private LocalDateTime birth;

@Column(name = "JOB", nullable = false)
private String job;

@Column(name = "INFO", nullable = false)
private String info;

@Column(name = "AGENCY", nullable = false)
private String agency;

@Column(name = "AI_RATE", nullable = false)
private Float aiRate;
}
25 changes: 25 additions & 0 deletions src/main/java/com/backend/soullive_a/entity/ModelImageKeyword.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.backend.soullive_a.entity;

import jakarta.persistence.*;
import lombok.*;

@Entity
@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor(access = AccessLevel.PROTECTED)

public class ModelImageKeyword {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "MODEL_IMAGE_KEYWORD_ID", nullable = false)
private Long id;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "MODEL_ID", nullable = false)
private Model model;

@Column(name = "KEYWORD", nullable = false)
private String keyword;
}
17 changes: 17 additions & 0 deletions src/main/java/com/backend/soullive_a/entity/ModelIntroduction.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.backend.soullive_a.entity;

import jakarta.persistence.*;
import lombok.*;

@Entity
@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class ModelIntroduction {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@OneToOne
@JoinColumn(name = "MODEL_ID", nullable = false) //식별 관계
private Model model;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.backend.soullive_a.entity;

import jakarta.persistence.*;
import lombok.*;

@Entity
@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class ModelRecentAdvertisement {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "MODEL_RECENT_ADVERTISEMENT_ID", nullable = false)
private Long id;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "MODEL_ID", nullable = false)
private Model model;
}
38 changes: 38 additions & 0 deletions src/main/java/com/backend/soullive_a/entity/ModelRecentWork.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.backend.soullive_a.entity;

import jakarta.persistence.*;
import lombok.*;

@Entity
@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class ModelRecentWork {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "MODEL_RECENT_WORK_ID", nullable = false)
private Long id;

@Column(name = "YEAR", nullable = false)
private Integer year;

@Column(name = "CATEGORY", nullable = false)
private String category;

@Column(name = "TITLE", nullable = false)
private String title;

@Column(name = "GENRE", nullable = false)
private String genre;

@Column(name = "ROLE", nullable = false)
private String role;

@Column(name = "IS_MAIN_ACTOR", nullable = false)
private Boolean isMainActor;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "MODEL_ID", nullable = false)
private Model model;
}

0 comments on commit 41477d0

Please sign in to comment.