|
1 | 1 | package com.gachigage.product.domain; |
2 | 2 |
|
3 | | -import jakarta.persistence.*; |
| 3 | +import jakarta.persistence.Column; |
| 4 | +import jakarta.persistence.Entity; |
| 5 | +import jakarta.persistence.FetchType; |
| 6 | +import jakarta.persistence.GeneratedValue; |
| 7 | +import jakarta.persistence.GenerationType; |
| 8 | +import jakarta.persistence.Id; |
| 9 | +import jakarta.persistence.JoinColumn; |
| 10 | +import jakarta.persistence.ManyToOne; |
| 11 | +import jakarta.persistence.Table; |
4 | 12 | import lombok.AccessLevel; |
5 | 13 | import lombok.Builder; |
6 | 14 | import lombok.Getter; |
|
12 | 20 | @Table(name = "product_price") |
13 | 21 | public class ProductPrice { |
14 | 22 |
|
15 | | - @Id |
16 | | - @GeneratedValue(strategy = GenerationType.IDENTITY) |
17 | | - @Column(name = "id") |
18 | | - private Long id; |
| 23 | + @Id |
| 24 | + @GeneratedValue(strategy = GenerationType.IDENTITY) |
| 25 | + @Column(name = "id") |
| 26 | + private Long id; |
19 | 27 |
|
20 | | - @ManyToOne(fetch = FetchType.LAZY) |
21 | | - @JoinColumn(name = "product_id", nullable = false) |
22 | | - private Product product; |
| 28 | + @ManyToOne(fetch = FetchType.LAZY) |
| 29 | + @JoinColumn(name = "product_id", nullable = false) |
| 30 | + private Product product; |
23 | 31 |
|
24 | | - @Column(name = "quantity", nullable = false) |
25 | | - private int quantity; |
| 32 | + @Column(name = "quantity", nullable = false) |
| 33 | + private int quantity; |
26 | 34 |
|
27 | | - @Column(name = "price", nullable = false) |
28 | | - private int price; |
| 35 | + @Column(name = "price", nullable = false) |
| 36 | + private int price; |
29 | 37 |
|
30 | | - @Column(name = "status", nullable = false) |
31 | | - private PriceTableStatus status; |
| 38 | + @Column(name = "status", nullable = false) |
| 39 | + private PriceTableStatus status; |
32 | 40 |
|
33 | | - @Builder |
34 | | - public ProductPrice(Product product, int quantity, int price, PriceTableStatus status) { |
35 | | - this.product = product; |
36 | | - this.quantity = quantity; |
37 | | - this.price = price; |
38 | | - this.status = status; |
39 | | - } |
| 41 | + @Builder |
| 42 | + public ProductPrice(Product product, int quantity, int price, PriceTableStatus status) { |
| 43 | + this.product = product; |
| 44 | + this.quantity = quantity; |
| 45 | + this.price = price; |
| 46 | + this.status = status; |
| 47 | + } |
40 | 48 |
|
41 | | - public void setProduct(Product product) { |
42 | | - this.product = product; |
43 | | - } |
| 49 | + public void setProduct(Product product) { |
| 50 | + this.product = product; |
| 51 | + } |
44 | 52 |
|
45 | | - public void inActive() { |
46 | | - this.status = PriceTableStatus.INACTIVE; |
47 | | - } |
| 53 | + public void inActive() { |
| 54 | + this.status = PriceTableStatus.INACTIVE; |
| 55 | + } |
48 | 56 |
|
49 | | - public void deprecated() { |
50 | | - this.status = PriceTableStatus.DEPRECATED; |
51 | | - } |
| 57 | + public void deprecated() { |
| 58 | + this.status = PriceTableStatus.DEPRECATED; |
| 59 | + } |
52 | 60 | } |
0 commit comments