Skip to content

Commit

Permalink
#16 - Feat: 도서 등록시 해시태그 기능을 위해 ProductHashTag, ProductKeyword 엔티티 설계
Browse files Browse the repository at this point in the history
  • Loading branch information
ahah525 committed Oct 24, 2022
1 parent c1e3a31 commit 5ca63f2
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
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; // 키워드
}
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; // 해시태그
}

0 comments on commit 5ca63f2

Please sign in to comment.