From d9fc388f8c2c334e1f097fde710d79e5ee9a156d Mon Sep 17 00:00:00 2001 From: seo-young Date: Thu, 7 Mar 2024 14:13:13 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20MovieInPlaylist=20=EB=8F=84=EB=A9=94?= =?UTF-8?q?=EC=9D=B8,=20repository=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/entity/MovieInPlaylist.java | 32 +++++++++++++++++++ .../MovieInPlaylistRepository.java | 7 ++++ 2 files changed, 39 insertions(+) create mode 100644 src/main/java/com/mookive/mookive_backend/movieInPlaylist/domain/entity/MovieInPlaylist.java create mode 100644 src/main/java/com/mookive/mookive_backend/movieInPlaylist/domain/respository/MovieInPlaylistRepository.java diff --git a/src/main/java/com/mookive/mookive_backend/movieInPlaylist/domain/entity/MovieInPlaylist.java b/src/main/java/com/mookive/mookive_backend/movieInPlaylist/domain/entity/MovieInPlaylist.java new file mode 100644 index 0000000..86511cf --- /dev/null +++ b/src/main/java/com/mookive/mookive_backend/movieInPlaylist/domain/entity/MovieInPlaylist.java @@ -0,0 +1,32 @@ +package com.mookive.mookive_backend.movieInPlaylist.domain.entity; + +import com.mookive.mookive_backend.movie.domain.entity.Movie; +import com.mookive.mookive_backend.playlist.domain.entity.Playlist; +import jakarta.persistence.*; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Entity +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class MovieInPlaylist { + + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne + @JoinColumn(name = "playlist_id") + private Playlist playlist; + + @ManyToOne + @JoinColumn(name = "movie_id") + private Movie movie; + + @Builder + public MovieInPlaylist(Playlist playlist, Movie movie) { + this.playlist = playlist; + this.movie = movie; + } +} diff --git a/src/main/java/com/mookive/mookive_backend/movieInPlaylist/domain/respository/MovieInPlaylistRepository.java b/src/main/java/com/mookive/mookive_backend/movieInPlaylist/domain/respository/MovieInPlaylistRepository.java new file mode 100644 index 0000000..befbaa1 --- /dev/null +++ b/src/main/java/com/mookive/mookive_backend/movieInPlaylist/domain/respository/MovieInPlaylistRepository.java @@ -0,0 +1,7 @@ +package com.mookive.mookive_backend.movieInPlaylist.domain.respository; + +import com.mookive.mookive_backend.movieInPlaylist.domain.entity.MovieInPlaylist; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface MovieInPlaylistRepository extends JpaRepository { +}