Skip to content

Commit

Permalink
feat : #11-모델소개 테이블 및 하위 테이블 3개 엔티티 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
j2noo committed Mar 2, 2024
1 parent 7da4e66 commit ac20181
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
package com.backend.soullive_a.domain;
package com.backend.soullive_a.entity;

import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.*;

@Entity
@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Model {
@Id
Expand All @@ -21,11 +19,11 @@ public class Model {
private String modelName;
private Integer age;

@Builder
public Model(Long modelId,String modelName,Integer age) {
this.modelId = modelId;
this.modelName = modelName;
this.age = age;
}
// @Builder
// public Model(Long modelId,String modelName,Integer age) {
// this.modelId = modelId;
// this.modelName = modelName;
// this.age = age;
// }

}
29 changes: 29 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,29 @@
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)
private Long modelImageKeywordId;

@ManyToOne
@JoinColumn(name = "model_id") //비식별인데..
private Model model;
private String keyword;


// @Builder
// public ModelImageKeyword(Model model, String keyword) {
// this.model = model;
// this.keyword = keyword;
// }
}
22 changes: 22 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,22 @@
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") //식별
private Model model;

// @Builder
// public ModelIntroduction(Model model) {
// this.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)
private Long modelRecentAdvertisementId;

@ManyToOne
@JoinColumn(name = "model_id")
private Model model;
}
27 changes: 27 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,27 @@
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)
private Long modelRecentWorkId;

private Integer year;
private String category;
private String title;
private String genre;
private String role;
private Boolean isMainActor;

@ManyToOne
@JoinColumn(name = "model_id")
private Model model;
}

0 comments on commit ac20181

Please sign in to comment.