-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#16 - Feat: 도서 등록시 해시태그 기능을 위해 ProductHashTag, ProductKeyword 엔티티 설계
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
...mutbooks/src/main/java/com/example/mutbooks/app/productHashTag/entity/ProductHashTag.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,32 @@ | ||
package com.example.mutbooks.app.productHashTag.entity; | ||
|
||
import com.example.mutbooks.app.base.entity.BaseEntity; | ||
import com.example.mutbooks.app.member.entity.Member; | ||
import com.example.mutbooks.app.product.entity.Product; | ||
import com.example.mutbooks.app.productKeyword.entity.ProductKeyword; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import javax.persistence.Entity; | ||
import javax.persistence.FetchType; | ||
import javax.persistence.ManyToOne; | ||
|
||
@Entity | ||
@Getter | ||
@Setter | ||
@SuperBuilder | ||
@NoArgsConstructor | ||
@ToString(callSuper = true) | ||
public class ProductHashTag extends BaseEntity { | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
private Member member; // 회원 | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
private Product product; // 도서 | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
private ProductKeyword productKeyword; // 키워드 | ||
} |
22 changes: 22 additions & 0 deletions
22
...mutbooks/src/main/java/com/example/mutbooks/app/productKeyword/entity/ProductKeyword.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,22 @@ | ||
package com.example.mutbooks.app.productKeyword.entity; | ||
|
||
import com.example.mutbooks.app.base.entity.BaseEntity; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
|
||
@Entity | ||
@Getter | ||
@Setter | ||
@SuperBuilder | ||
@NoArgsConstructor | ||
@ToString(callSuper = true) | ||
public class ProductKeyword extends BaseEntity { | ||
@Column(unique = true) | ||
private String content; // 해시태그 | ||
} |