-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feat] product entity 작성
- Loading branch information
Showing
8 changed files
with
163 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.backend.soullive_a.constant; | ||
|
||
public enum AgeType { | ||
TEN,TWENTY,THIRTEEN, FOURTEEN, FIFTEEN, SIXTEEN | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/com/backend/soullive_a/constant/GenderType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.backend.soullive_a.constant; | ||
|
||
public enum GenderType { | ||
Male, Female | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.backend.soullive_a.entity; | ||
|
||
import com.backend.soullive_a.constant.AgeType; | ||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
@Entity | ||
@Table(name = "AGE") | ||
@Builder | ||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class Age { | ||
@Id | ||
@GeneratedValue | ||
@Column(name = "AGE_ID") | ||
private Long id; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "PRODUCT_ID", nullable = false) | ||
private Product product; | ||
|
||
@Enumerated(EnumType.STRING) | ||
@Column(name = "AGE_TYPE") | ||
private AgeType age; | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/com/backend/soullive_a/entity/BrandImage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.backend.soullive_a.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
@Entity | ||
@Table(name = "BRAND_IMAGE") | ||
@Builder | ||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class BrandImage { | ||
@Id | ||
@GeneratedValue | ||
@Column(name = "BRAND_IMAGE_ID") | ||
private Long id; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "PRODUCT_ID", nullable = false) | ||
private Product product; | ||
|
||
@Column(name = "BRAND_IMAGE") | ||
private String brandImage; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.backend.soullive_a.entity; | ||
|
||
import com.backend.soullive_a.constant.GenderType; | ||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
@Entity | ||
@Table(name = "GENDER") | ||
@Builder | ||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class Gender { | ||
@Id | ||
@GeneratedValue | ||
@Column(name = "GENDER_ID") | ||
private Long id; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "PRODUCT_ID", nullable = false) | ||
private Product product; | ||
|
||
@Enumerated(EnumType.STRING) | ||
@Column(name = "GENDER_TYPE") | ||
private GenderType gender; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
@Table(name = "PRODUCT") | ||
@Builder | ||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class Product { | ||
@Id | ||
@GeneratedValue | ||
@Column(name = "PRODUCT_ID", nullable = false) | ||
private Long id; | ||
|
||
@Column(name = "COMPANY", nullable = false) | ||
private String company; | ||
|
||
@Column(name = "BRAND", nullable = true) | ||
private String brand; | ||
|
||
@Column(name = "PRODUCT", nullable = false) | ||
private String product; | ||
|
||
@Column(name = "CHARACTERISTIC", nullable = false) | ||
private String characteristic; | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/com/backend/soullive_a/entity/ProductImage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.backend.soullive_a.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
@Entity | ||
@Table(name = "PRODUCT_IMAGE") | ||
@Builder | ||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class ProductImage { | ||
@Id | ||
@GeneratedValue | ||
@Column(name = "PRODUCT_IMAGE_ID", nullable = false) | ||
private Long id; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "PRODUCT_ID", nullable = false) | ||
private Product product; | ||
|
||
@Column(name = "PRODUCT_IMAGE", nullable = false) | ||
private String productImage; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.backend.soullive_a.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
@Entity | ||
@Table(name = "TARGETRANGE") | ||
@Builder | ||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class Range { | ||
@Id | ||
@GeneratedValue | ||
@Column(name = "RANGE_ID", nullable = false) | ||
private Long id; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "PRODUCT_ID", nullable = false) | ||
private Product product; | ||
|
||
@Column(name = "RANGE_VALUE", nullable = false) | ||
private String range; | ||
} |