Skip to content

Commit

Permalink
feat: #10 product entity 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
sominyun committed Mar 3, 2024
1 parent 97a4c58 commit f28ccdc
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 21 deletions.
2 changes: 0 additions & 2 deletions src/main/java/com/backend/soullive_a/entity/Age.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
import lombok.extern.slf4j.Slf4j;
import org.hibernate.annotations.DynamicInsert;

@Slf4j
@Entity
@Table(name = "AGE")
@Builder
@Getter
@DynamicInsert
@AllArgsConstructor
@NoArgsConstructor
public class Age {
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/backend/soullive_a/entity/BrandImage.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@
import lombok.extern.slf4j.Slf4j;
import org.hibernate.annotations.DynamicInsert;

@Slf4j
@Entity
@Table(name = "BRAND_IMAGE")
@Builder
@Getter
@DynamicInsert
@AllArgsConstructor
@NoArgsConstructor
public class BrandImage {
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/backend/soullive_a/entity/Gender.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
import lombok.extern.slf4j.Slf4j;
import org.hibernate.annotations.DynamicInsert;

@Slf4j
@Entity
@Table(name = "GENDER")
@Builder
@Getter
@DynamicInsert
@AllArgsConstructor
@NoArgsConstructor
public class Gender {
Expand Down
12 changes: 5 additions & 7 deletions src/main/java/com/backend/soullive_a/entity/Product.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,27 @@
import java.util.ArrayList;
import java.util.List;

@Slf4j
@Entity
@Table(name = "PRODUCT")
@Builder
@Getter
@DynamicInsert
@AllArgsConstructor
@NoArgsConstructor
public class Product {
@Id
@GeneratedValue
@Column(name = "PRODUCT_ID")
@Column(name = "PRODUCT_ID", nullable = false)
private Long id;

@Column(name = "COMPANY", length = 100)
@Column(name = "COMPANY", nullable = false)
private String company;

@Column(name = "BRAND", length = 100)
@Column(name = "BRAND", nullable = true)
private String brand;

@Column(name = "PRODUCT", length = 100)
@Column(name = "PRODUCT", nullable = false)
private String product;

@Column(name = "CHARACTERISTIC")
@Column(name = "CHARACTERISTIC", nullable = false)
private String characteristic;
}
6 changes: 2 additions & 4 deletions src/main/java/com/backend/soullive_a/entity/ProductImage.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,22 @@
import lombok.extern.slf4j.Slf4j;
import org.hibernate.annotations.DynamicInsert;

@Slf4j
@Entity
@Table(name = "PRODUCT_IMAGE")
@Builder
@Getter
@DynamicInsert
@AllArgsConstructor
@NoArgsConstructor
public class ProductImage {
@Id
@GeneratedValue
@Column(name = "PRODUCT_IMAGE_ID")
@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")
@Column(name = "PRODUCT_IMAGE", nullable = false)
private String productImage;
}
6 changes: 2 additions & 4 deletions src/main/java/com/backend/soullive_a/entity/Range.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,21 @@
import lombok.extern.slf4j.Slf4j;
import org.hibernate.annotations.DynamicInsert;

@Slf4j
@Entity(name = "RANGE")
@Builder
@Getter
@DynamicInsert
@AllArgsConstructor
@NoArgsConstructor
public class Range {
@Id
@GeneratedValue
@Column(name = "RANGE_ID")
@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")
@Column(name = "RANGE", nullable = false)
private String rangeType;
}

0 comments on commit f28ccdc

Please sign in to comment.