JPA Relation Study

Tables (4)

Comment (댓글)

  • comment_id (댓글 아이디) — int — Primary key — NOT NULL
  • post_id (게시글 아이디) — Foreign key → Post.post_id — NOT NULL
  • user_id (작성자 아이디) — int — Foreign key → User.user_id — NOT NULL
  • content (내용) — String

Like (좋아요)

  • like_id (좋아요 아이디) — Primary key — NOT NULL
  • post_id (게시글 아이디) — Foreign key → Post.post_id — NOT NULL
  • user_id (사용자 아이디) — Foreign key → User.user_id — NOT NULL

Post (게시글)

  • post_id (게시글 아이디) — int — Primary key — NOT NULL
  • user_id (작성자 아이디) — int — Foreign key → User.user_id — NOT NULL
  • content (내용) — String
  • title (제목) — String

User (사용자)

  • user_id (사용자 아이디) — int — Primary key — NOT NULL
  • name (사용자 이름) — String