File tree Expand file tree Collapse file tree 4 files changed +44
-0
lines changed
src/main/java/ttakkeun/ttakkeun_server/entity Expand file tree Collapse file tree 4 files changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ package ttakkeun .ttakkeun_server .entity ;
2
+
3
+ import jakarta .persistence .*;
4
+ import lombok .AccessLevel ;
5
+ import lombok .AllArgsConstructor ;
6
+ import lombok .Getter ;
7
+ import lombok .NoArgsConstructor ;
8
+ import org .springframework .data .jpa .domain .support .AuditingEntityListener ;
9
+
10
+ @ Entity
11
+ @ Getter
12
+ @ NoArgsConstructor (access = AccessLevel .PROTECTED )
13
+ @ AllArgsConstructor
14
+ public class LikeProduct {
15
+ @ Id
16
+ @ Column (name = "like_product_id" )
17
+ @ GeneratedValue (strategy = GenerationType .IDENTITY )
18
+ private Long id ;
19
+
20
+ @ ManyToOne (fetch = FetchType .LAZY )
21
+ @ JoinColumn (name = "product_id" )
22
+ private Product product ;
23
+
24
+ @ ManyToOne (fetch = FetchType .LAZY )
25
+ @ JoinColumn (name = "member_id" )
26
+ private Member member ;
27
+ }
Original file line number Diff line number Diff line change 2
2
3
3
import jakarta .persistence .*;
4
4
import lombok .*;
5
+ import org .springframework .data .relational .core .sql .Like ;
5
6
import ttakkeun .ttakkeun_server .entity .common .BaseEntity ;
6
7
import ttakkeun .ttakkeun_server .entity .enums .LoginType ;
7
8
@@ -39,6 +40,9 @@ public class Member extends BaseEntity {
39
40
@ OneToMany (mappedBy = "memberId" , cascade = CascadeType .ALL )
40
41
private List <Pet > petList = new ArrayList <>();
41
42
43
+ @ OneToMany (mappedBy = "memberId" , cascade = CascadeType .ALL )
44
+ private List <LikeProduct > likeProductList = new ArrayList <>();
45
+
42
46
// refreshToken 재발급
43
47
public void updateRefreshToken (String refreshToken ) {
44
48
this .refreshToken = refreshToken ;
Original file line number Diff line number Diff line change 5
5
import ttakkeun .ttakkeun_server .entity .common .BaseEntity ;
6
6
import ttakkeun .ttakkeun_server .entity .enums .Category ;
7
7
8
+ import java .util .ArrayList ;
9
+ import java .util .List ;
10
+
8
11
@ Entity
9
12
@ Getter
10
13
@ Builder
@@ -17,6 +20,13 @@ public class Product extends BaseEntity {
17
20
@ GeneratedValue (strategy = GenerationType .IDENTITY )
18
21
private Long productId ;
19
22
23
+ @ ManyToOne (fetch = FetchType .LAZY )
24
+ @ JoinColumn (name = "result_id" )
25
+ private Result result ;
26
+
27
+ @ OneToMany (mappedBy = "productId" , cascade = CascadeType .ALL )
28
+ private List <LikeProduct > likeProductList = new ArrayList <>();
29
+
20
30
private String productTitle ;
21
31
private String productLink ;
22
32
private String productImage ;
Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ public class Result extends BaseEntity {
20
20
@ GeneratedValue (strategy = GenerationType .IDENTITY )
21
21
private Long resultId ;
22
22
23
+ @ OneToMany (mappedBy = "resultId" )
24
+ private List <Product > ProductList = new ArrayList <>();
25
+
23
26
@ OneToMany (mappedBy = "resultId" , cascade = CascadeType .ALL )
24
27
private List <Record > RecordList = new ArrayList <>();
25
28
You can’t perform that action at this time.
0 commit comments